[IOS Weibo project, [iOS blog Project

Source: Internet
Author: User

[IOS Weibo project, [iOS blog Project
Github: https://github.com/hellovoidworld/HVWWeibo
A. Light gray background of Weibo1. Requirements

  • The background color needs to be set for the Weibo part.
  • Use an image as the background
2. IdeasMethods:
  • Directly set the background image of the view and use the tiled image of UIColor.
  • Achieve the drawRect method of view, stretch the background image (draw the background image to the entire view)
  • Forward the Weibo view to inherit the ImageView and set the image directly. In this way, you can set the highlighted image.
3. Implementation(1) directly set backgroundColor and tile images
1 // set the Background 2 // set the background image in Tiled Mode 3 self. backgroundColor = [UIColor colorWithPatternImage: [UIImage imageWithNamed: @ "timeline_retweet_background"];
However, because the image is tiled, the upper and lower edges of the image form many "thin lines" 1-(void) drawRect :( CGRect) rect {2 [[UIImage imageWithNamed: @ "timeline_retweet_background"] drawInRect: self. bounds]; 3} 1 // set the background image 2 [self setImage: [UIImage imageWithNamed: @ "timeline_retweet_background"]; 3 [self setHighlightedImage: [UIImage imageWithNamed: @ "timeline_retweet_background_highlighted"];

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.