Use of Uilabel and Uiimageview

Source: Internet
Author: User

Uilabel Use main features: Display text for content hints Common properties
NSString*text;//uilabel the text content displayed;Uicolor*textcolor;//color of text displaycgsize*shadowcolor;//Shadow of text displayNstextalignment textalignment;//Text alignment (left-aligned, centered, right -aligned)Uicolor*highlightedtextcolor;//Text highlighting Yes display colorBOOLhighlighted;//Set text highlightingNslinebreakmode Linebreakmode;//If you need to set this property for multiple lines of displayBOOLuserinteractionenabled;//uilabel whether to allow interactionNsintegerNumberOfLines;//Uilabel text displays the number of lines, if 0 means no limitBOOLAdjustsfontsizetofitwidth;//Adjust font size according to Uilabel size
Main features of Uiimageview: View common properties used primarily for displaying pictures in an application
UIImage          *image;//UIImageView显示的图片内容,默认是nilUIImage          *highlightedImage;//当UIImageView被选中的时候显示的图片内容 默认是nilBOOL             userInteractionEnabled;//UIImageView及其上得元素是否交互(非常重要)BOOL             highlighted;//UIImageView是否是高亮状态
Initialize method - (id)initWithImage:(UIImage*)image; - (id)initWithImage:(UIImage*)image highlightedImage:(UIImage*)highlightedImage;Animate playback effects
#import "ViewController.h"  @interface viewcontroller ()@property(Strong,nonatomic)Uiimageview*imageview;@end @implementation viewcontroller - (void) Viewdidload {[SuperViewdidload];additional setup after loading the view, typically from a nib.    //Define an array to hold the picture object    Nsarray*imagesarray = [[NsarrayAlloc] Initwithobjects: [UIImageimagenamed:@"Xiaohai.jpg"],                            [UIImageimagenamed:@"Xiaogou.jpg"],                            [UIImageimagenamed:@"Songshu.jpg"],Nil];//Initialize a picture view_imageview = [[UiimageviewAlloc] Initwithframe:cgrectmake ( -, Max, Max, the)];//Assign a picture array to an animated picture of the picture view_imageview. Animationimages= Imagesarray;//Set the picture to be scaled by the original scale. Maintain aspect ratio_imageview. Contentmode= Uiviewcontentmodescaleaspectfit;//Toggle action Duration, seconds_imageview. Animationduration=2;//Animation repeat times, 0 o'clock free cycle_imageview. Animationrepeatcount=0; [ Self. ViewAddsubview:_imageview];} - (ibaction) Playanimation: (ID) Sender {if(_imageview. isanimating) {[_imageview stopanimating];//Pause playback}Else{[_imageview startanimating];//Start playback}}

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Use of Uilabel and Uiimageview

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.