UITableViewCell the background color of the child view is clear when selected

Source: Internet
Author: User

in TableView, when the cell is in hightlighted (highlighted) or selected (checked) state, the background color of the child controls on the cell is Clear.

Solution: (4 kinds)

1. Directly set the background color of the layer of the child control, the layer will not be affected

2. Override the method to perform

-(void) sethighlighted: (BOOL) highlighted animated: (BOOL) animated{

[Super sethighlighted:highlighted animated:animated];

Set child control color again

}

-(void) setselected: (BOOL) selected animated: (bool) Animated {

[Super setselected:selected animated:animated];

Set child control color again

}

3. Child controls inherit the parent class, overriding the SetBackgroundColor method, doing nothing,

Rewrite a method to set the background color, execute [super Setbackgroundcolor:color];

4. Set the background image to

UITableViewCell the background color of the child view is clear when selected

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.