[Rookie growth Kee]ios Development Self-study note 05-prototype cells using AutoLayout

Source: Internet
Author: User

It happened to me. In a tabular view, I'm going to add a table cell row to the left to show the action of the Delete button, so it's easier to do it. Just define the method

-(void) TableView: (UITableView *) TableView Commiteditingstyle: (uitableviewcelleditingstyle) Editingstyle Forrowatindexpath: (Nsindexpath *) Indexpath

Even if you do not include any method implementation part of the code, as long as the definition of this method, after compiling the program, the left East China Cell line is able to appear delete button, but the day I did so, the deletion of the button will not come out anyway. At first it was a question of the procedure, and the internet had not seen a similar problem for a long time. Later calm down to think about, it must be the beginning of their own thinking direction out of the problem, carefully study the Nether UI, only to find that the Delete button can not be displayed, but the table cell row is displayed more than the width of the screen size, the actual button is displayed on the screen "outside."

Put a segmented control on the newly created prototype cell, first adjust the AutoLayout constraint for segmented control, and make sure all the guides have been turned into blue running programs and get the result.

Can see segmented control is not completely in the horizontal direction can be displayed, it looks like a part of the screen is displayed outside, at first it was strange that the result, obviously segmented control has sufficient constraints to make it normal display, Why is it still not showing? Originally, the segmented control's parent view-tableview the constraint relative to its parent view-view is not established, that is, only one layer of relative position constraint is established, and what is actually displayed on the screen is to be displayed as a parent view Then click on the previously dragged TableView view, after the establishment of leading,trailing,top,bottom, the result will appear as follows:

You can see that the segmented control is already displayed normally, and the Delete button will display normally when you swipe left

[Rookie growth Kee]ios Development Self-study note 05-prototype cells using AutoLayout

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.