Custom plain style tableview, the splitter line is not displayed on the simulator, but the split line is displayed on the real machine.

Source: Internet
Author: User

One, experience

1> Custom plain-style tableview, the splitter line is not displayed on the emulator, but the split line below the cell is displayed on the real machine.

2> attempted to use the Separatorstyle property of the table, attempting to fail. Try using a table of type grouped, set the proxy method for Headerview and Footview, or The Tablefooterview property does not take effect.

3> colleague location to the problem should be, has set the Separatorstyle property, and then by some of the system's properties are overwritten, and no data cells are automatically created by the system.

4> colleagues then let me ① in Viewdidappear and other methods to reset the Separatorstyle property, and ② to set the Tablefooterview property to a normal UIView control, the result is really successful.

The code is as follows:

1 -(void) layoutsubviews{2    [Super layoutsubviews]; 3     // Reset Split Line 4     Self.separatorstyle = Uitableviewcellseparatorstylenone; 5 }
1     // Add the following statement to the construction method or Viewdidload method 2     Self.tablefooterview = [[UIView alloc]initwithframe:cgrectmake (0011)] ;

Second, Experience summary

1> whatever the bug, try to think about the cause. This bug is probably due to the fact that the system continues to create the remaining unused cells as a tablefooterview.

2> Multi-analysis, can improve their ability.

Custom plain style tableview, the splitter line is not displayed on the simulator, but the split line is displayed on the real machine.

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.