Publish original cool code-connect Dong Boran github and Dong Boran github

Source: Internet
Author: User

Publish original cool code-connect Dong Boran github and Dong Boran github

Public part of github Project (all original) More code please see https://github.com/dsxNiubility
SXWaveAnimate SXFiveScoreShow SXPhotoShow SXNews

Main introduction:

The demo program is used to create a watering effect in a circular container. The demo program transfers values from the previous page to produce an animation. It can also be used to refresh the animation after the data is obtained on the current page. Now the encapsulation is basically complete, and users need to reuse the custom cell I wrote. Three styles are provided, and some expansion functions such as unlimited water and flower flows will be improved in the future.

 Main introduction:

This program is about drawing charts. Input five parameter values 0 ~ 5.0. The Pentagon is calculated and drawn based on the ratio, and a comparison value can be provided to draw another (Green chart) and compare it with its own score. It also sets the animation expansion effect, better visual effects. The user can customize a lot of places, and now provides three dimensions, based on the number of values you want to pass to determine the triangle, quadrilateral or Pentagon.

Main introduction:

This is mainly used for image display. The three custom la s of collectionView are written in this section. They also provide ideas. You can also think of them to make more la S. It is easy to use: drag the layout file into the project, and upload a layout when creating the collection file. It is also interesting to add a click Delete effect.

 

Main introduction:

Excellent Netease news. In my spare time, I made some work on Netease UI, cutting Netease image materials and capturing Netease interfaces. It completes the main navigation page, news details page, picture browsing page, and comment page. Good results, better than the various code circulating on the Internet Related To Netease news UI architecture. There are many projects similar to this imitation, such as Baidu doctor, Sina Weibo, and the old version of Meituan.

 

Published more than 300 million stars in more than half a month

Click to download from github

No stars have just been published. Thank you for your reference.

Click to download from github

No stars have just been published. Thank you for your reference.

Click to download from github

In the past, there were 40 stars available in a small scale.

Click to download from github

The following is a detailed description of these projects.

SXWaveAnimate upgraded version on April 9, June 2 (recommended)

Encapsulates the animation code into the Cell and provides a unified interface and value assignment method.

Usage

1. Drag the classes folder in the code into the project, which contains a custom Cell and a class to facilitate frame computing.
2. Introduce the header file in the required class (that is, the class for writing the tableView data source method and proxy method)
#import "SXWaveCell.h"
3. Change the previous UITableView Cell * cell to the desired location in the cellforRow of the data source method.
SXWaveCell *cell = [SXWaveCell cell];
self.waveCell = cell;
[cell setPrecent:self.precent textColor:[UIColor orangeColor] type:0 alpha:1];
return cell;
4. in the third row, the setPrecent: textColor: type: alpha: method is a value assignment method. Now, all four parameters must be passed. In the future, multiple interfaces will be set to pass only the required values.
5. There are two methods in the source code: one is to click cell to trigger the animation after the page is displayed, and the other is to display the animation as soon as you enter it.viewDidAppearMethod to add a line to start the animation[self.waveCell addAnimateWithType:0];

The specific code written in the sample program is clear and easy to use.

Initial version

Because the main functions are implemented in the early stage, the interface encapsulation is not perfect and will be improved soon. The current code structure is also very clear and can be reused.

Three styles are currently available.

The first type is pure white background orange text. The second type is deep green text with a translucent background. The color interface will be provided later. The third is that the color is pure white and the background is deeper. Compared with the first two, the third is to fill the water level and then drop it to the specified height.

You can also modify it based on your preferences.

 

SXFiveScoreShow

A Pentagon similar to the five capabilities of a real football player.

This program is about drawing charts. Input five parameter values 0 ~ 5.0. The Pentagon is calculated and drawn based on the ratio, and a comparison value can be provided to draw another (Green chart) and compare it with its own score. It also sets the animation expansion effect, better visual effects. The user can customize a lot of places, and now provides three dimensions, based on the number of values you want to pass to determine the triangle, quadrilateral or Pentagon.

The demo sample program on the home page has built a complete example. Generally, this third-party library can be referenced in this example.

Two Styles

Configurable properties are provided internally. By controlling the showType to 1 or 2, the Pentagons can be displayed as solid colors or borders.

Three Dimensions

In the example, the first page shows the scores of the five dimensions and the scores of the five dimensions, dimension 5 is drawn using the passed value (an array is passed in ). Then, both dimension 3 and dimension 4 take the preceding three values and the four values for plotting.

Usage:
1. drag SXFiveScore from the resource folder in the code to project 2. introduce the main header file # import "SXFiveScoreCell. h "3. you can add SXFiveScoreCell to tableView and add SXAnimateView to ViewController for display. However, the second method is not well encapsulated. We recommend the first method for the moment. 4. Use the SXFiveScoreCell class in the tableView data source method to create a cell. 5. You can obtain the data by sending a request to this page, or by uploading the data from the previous page ~ 5 0 ~ A value between 5.0 and is integrated into an array. (If you want to set a comparison view, you need to write two arrays.) 6. then, the cell value is transferred to the two member variables of the cell. scores = mScoreArray; cell. compareScores = mCompareArray. if you want to automatically create an animation after entering the page, refer to the method used in the demo to use member variables and control them in viewdidappear.

SXPhotoShow

UICollectionViewFlowLayout the flow layout is a common and common layout method in collectionView. This Code also writes three nice la S. The LineLayout and streamline layout have the same point and directly inherit UICollectionViewFlowLayout, then StackLayout, circleLayout is directly inherited from the original UICollectionViewLayout layout scheme.

SXStackLayout

Similar to the layout where cards are stacked in dislocation, what we can do for the time being is symmetric on two sides. When you click Delete cell or the number of cells changes, the layout is displayed again, and the angle is changed to produce the animation effect.

SXLineLayout

Is a straight line layout, but during the drag process, the cell size will change according to the change of its position, the maximum sliding to the center, the minimum on both sides. In addition, the processing has an adsorption effect. Every time it is about to stop, the cell closest to the center will be placed in the center.

SXCircleLayout

This is a ring layout, and the position will change with the overall number. You can click Delete in the demo to delete the last five items.

Usage

1. Create a project that you need, including collectionView and collectionCell (the simplest way in the demo)

2. ChangeLayoutDrag the folder into the project. There are three la s in it. If you want to use one, you can import the header file.
#import "SXStackLayout.h"-- Corresponds to the top
#import "SXLineLayout.h"-- Corresponds to the middle
#import "SXCircleLayout.h"-- The corresponding is below

3. Create a layout in the ViewDidLoad Method
SXCircleLayout *layout = [[SXCircleLayout alloc] init];
Enter the introduced layout in the collection initialization method.
UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 235)) collectionViewLayout:layout];

 

SXNews

News software that imitates Netease news

Excellent Netease news. In my spare time, I made some work on Netease UI, cutting Netease image materials and capturing Netease interfaces. It completes the main navigation page, news details page, picture browsing page, and comment page. The results are good, better than all the Code related to the Netease news UI architecture circulating on the Internet.

The main function of the main navigation page is that the title bar on the top can be moved. scrowView and collectionView can be recycled. When you click the title bar or move by gesture, the following pages will slide to the current page. In addition, the News Module is lazy to load. You can only load the pages you want to watch. This is achieved through the proxy method that controls the stop of two gestures in scrowView. The following news module provides four types of custom cells. It parses the data to determine which custom cell to load. The results enrich the homepage.

On the news details page, Netease's original interface returned data on the previous page contains both a url address and an xml string. The url address is not beautiful after it is displayed, therefore, the method is to parse the strings in xml format and display them in webView, which achieves text mixing and css style setting. The main highlight of this page is the passing of values between JS Code and OC code. After you click an image in webview, the saved style is displayed below. This is achieved by controlling a page redirect method to intercept requests.

The comment page is relatively simple, that is, a common custom cell. It is okay to control the custom line height. The label introduced by the user can be filtered using regular expressions. However, the main focus of writing this item is not detailed here in core functions.

The Image Viewer page basically achieves the imitation effect. The following text and 9/16 styles are dynamically calculated by the scrowView offset, and the homepage is also a lazy way to load images, A Netease placeholder image is displayed when the image is not displayed during image download.

  • This project also uses pull-up and pull-down refresh and some technical knowledge about parent-child controller nesting and custom navigation bar, which is also helpful for normal development.

Update the welcome star from time to time.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.