IOS6 and IOS7 code adaptation (4)--tableview

Source: Internet
Author: User

IOS7 a lot of control on the look of a change (after all, to flatten it), but the feeling of the greatest change is not tableview. Because the height of this control is customizable, it is used and widely, and such a change naturally affects quite a lot.

1.accessoryType

The biggest change in Tableviewcell Accessorytype is Uitableviewcellaccessorydetaildisclosurebutton, which in IOS6 is a reminder of the user's content, The iOS7 inside became Uitableviewcellaccessorydetailbutton.

2. Plain type of TableView

Plain this type of change is not small, in addition to from the object to the flat of a design idea, is a cell color adjustment.

In IOS6, the cell is the default use of transparent color, that is to show the TableView color, but iOS7 inside the cell default is white, will block the tableview background color.

3. TableView of Group Type

Group This type of change is more obvious, mainly for the processing of the header has changed.

IOS6, each section has a border line, section of the header about 10 pixel around, and the first section is closer to the upper end, there is no obvious white, but iOS7 inside the section of the border line is canceled, The header of section is about 35 pixel, and the style of each section is similar to the plain, and the first section and upper end have an obvious white space.

To modify this you can use the Heightforheaderinsection: method to set the height of the header.

[OBJC]View Plaincopyprint?
    1. -  (cgfloat) TableView: (uitableview *) Tableview heightforheaderinsection: (Nsinteger) section  
    2. {  
    3.     if  (section ==  0)  {  
    4.          return 10< Span class= "xcodeconstants" >.0;&NBSP;&NBSP;
    5.      } else {  
    6.          return 0;&NBSP;&NBSP;
    7. &NBSP;&NBSP;&NBSP;&NBSP;}&NBSP;&NBSP;
    8. }  
-(CGFloat) TableView: (UITableView *) TableView heightforheaderinsection: (nsinteger) section{    if (section = = 0) {        return 10.0;    } else {        return 0;    }}

Comparison of the results such as:

4. Dividing line

I find that this point is not mentioned in many places, it may be that people feel very natural, there is no need to say more. I think the gap in this place is still quite big, it is worth saying.

IOS6 when each cell divider line is from left to right, a complete one, iOS7 is the upper and lower border is complete, the middle of the shorter, if it is text, short, no feeling; but if you put a uiimage on the left, the divider starts after the image, This is obvious, especially when your image is not the same size, the starting point of the separation line is different, this will be quite ugly, so the recommended image size is consistent, at least one section must be consistent.

TableView in the iOS7 on the different points of course not only so many, I feel in the process of adaptation of these are more obvious, so take out a tan.

http://blog.csdn.net/sakulafly/article/details/18046065

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.