IOS UITableViewCell transparency and cell text Center

Source: Internet
Author: User

1. When UITableViewCell is created in UITableViewCellStyleValue1 mode, the transparency of UITableView is directly set as follows, but it is difficult to center the text. 2. When the UITableViewCell mode is UITableViewCellStyleDefault, the cell is used directly for text center. textAlignment = UITextAlignmentCenter; the pull is done, but only the transparency of UITableView is set. The background transparency is difficult to implement. Specific implementation code: cell. opaque = NO; cell. textLabel. backgroundColor = [UIColor clearColor]; [cell setBackgroundColor: [UIColor colorWithRed: 1 green: 1 blue: 1 alpha: 0.2]; set the transparency of UITableView to complete the setting.

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.