The third week of Tuesday iOS learning

Source: Internet
Author: User

Let's start by recording the first question, about how to make the page move from bottom to top when navigationcontroller push a page.

----

From TableView, the animation effect is controlled by code every time you click on a cell to enter another page.

As shown, this effect is when you click on a cell, another page appears from right to left, click Back and then go back.

------

2. Inserting data into multiple cells in a section in TableView

- (void) initdata{_datasourcearray= [[Nsmutablearray alloc] init];//This step is killing me.Nsmutabledictionary *dic1 =[[Nsmutabledictionary alloc] init]; [Dic1 setobject:@"your fans have purchased an order of $20"Forkey:@"fans"]; [Dic1 setobject:@"+ 6.0 USD"Forkey:@" Price"];        [_datasourcearray Addobject:dic1]; Nsmutabledictionary*dic2 =[[Nsmutabledictionary alloc] init]; [Dic2 setobject:@"your fans have purchased an order of $10"Forkey:@"fans"]; [Dic2 setobject:@"+ 11.0 USD"Forkey:@" Price"];        [_datasourcearray Addobject:dic2]; Nsmutabledictionary*DIC3 =[[Nsmutabledictionary alloc] init]; [Dic3 setobject:@"your fans have purchased an order of $15"Forkey:@"fans"]; [Dic3 setobject:@"+ 12.0 USD"Forkey:@" Price"];        [_datasourcearray ADDOBJECT:DIC3]; Nsmutabledictionary*DIC4 =[[Nsmutabledictionary alloc] init]; [Dic4 setobject:@"your fans have purchased an order of $23"Forkey:@"fans"]; [Dic4 setobject:@"+ 7.0 USD"Forkey:@" Price"];    [_datasourcearray ADDOBJECT:DIC4]; }

The data is first stored in the dictionary dictionary as a key-value pair, and then placed in the array.

-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) indexpath{//Nsindexpath is a struct that records group and row information.     StaticNSString *cellindentifier =@"Tableviewcell"; UITableViewCell*cell =[TableView Dequeuereusablecellwithidentifier:cellindentifier]; if(Cell = =Nil) {Cell=[[UITableViewCell alloc] initwithstyle:uitableviewcellstylevalue1 Reuseidentifier:cellindentifier]; }    if(Indexpath.section = =1) { cell.textLabel.text = [_datasourcearray[indexpath.row] Objectforkey:@ "fans" ]; Cell.detailTextLabel.text         = [_datasourcearray[indexpath.row] Objectforkey:@ "price" ]; Cell.detailTextLabel.textColor= [Uicolor colorwithred:104.0/255Green203.0/255Blue255.0/255Alpha1]; }        returncell;}

The data we deposited just now is taken out in the form of Objectforkey. Where Detailtextlabel is a sub-title, so it is very convenient, do not need to insert the label Ah, TextField what. You can also use Initwithstyle to set its style, whether it is a line-break display, or the rightmost side of the display.

About the post-ministry. http://blog.csdn.net/zhang_biao_1991/article/details/12584989. Attention should be paid to the details.

Effect

The issues left behind today include sharing and charting. Cut two sheets. If there is a will to do the great God would like to leave a message pointing to the idea (this has been bothering me for a long time).

These two features.

The third week of Tuesday iOS learning

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.