IOS开发UI基础UIActivityIndicatorView的属性

UIActivityIndicatorView

1.activityIndicatorViewStyle
设置指示器的样式
UIActivityIndicatorViewStyleWhiteLarge
UIActivityIndicatorViewStyleWhite  (默认样式)
UIActivityIndicatorViewStyleGray

2.hidesWhenStopped
当停止动画的时候,是否隐藏。默认为YES。

3. 实例化指示器对象,根据样式设置尺寸,不需要手动设置。
-(id)initWithActivityIndicatorStyle:(UIActivityIndicatorViewStyle)style;

4.开启动画
- (void)startAnimating;

5.关闭动画
- (void)stopAnimating;

6.是否在动画
- (BOOL)isAnimating;

7. UIActivityIndicatorView使用注意
7.1初始化的时候不需要设置尺寸,设置尺寸也没有效果。
7.2 必须调用startAnimating才会显示UIActivityIndicatorView
// 初始化指示器
    UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    // 设置指示器位置
    indicator.center = CGPointMake(self.view.frame.size.width * 0.5, self.view.frame.size.height * 0.5);
    // 开启动画,必须调用,否则无法显示
    [indicator startAnimating];
    
    [self.view addSubview:indicator];

时间: 2024-08-26 16:43:07

IOS开发UI基础UIActivityIndicatorView的属性的相关文章

IOS开发UI基础UITextFidle相关属性

UITextFidle相关属性 •    enablesReturnKeyAutomatically默认为No,如果设置为Yes,文本框中没有输入任何字符的话,右下角的返回按钮是disabled的. 1.borderStyle 设置边框样式,只有设置了才会显示边框样式   text.borderStyle = UITextBorderStyleRoundedRect; typedef enum {    UITextBorderStyleNone,     UITextBorderStyleLi

IOS开发UI基础UITableView的属性

UITableView UITableView内置了两种样式:UITableViewStylePlain,UITableViewStyleGrouped <UITableViewDataSource,UITableViewDelegate>里的方法: tableView处理步骤 #pragma mark 1.有多少组- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView #pragma mark 2.第section组

IOS开发UI基础UIImagePickerController的属性

UIImagePickerController 1.+(BOOL)isSourceTypeAvailable:(UIImagePickerControllerSourceType)sourceType;                 检查指定源是否在设备上可用.//检查照片源是否可用[UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary] 2.allowsEditi

IOS开发UI基础 UIAlertView的属性

UIAlertView1.Title获取或设置UIAlertView上的标题. 2.Message获取或设置UIAlertView上的消息 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定&q

IOS开发UI基础 UIDatePicker的属性

UIDatePicker        •    Locale设置DatePicker的地区,即设置DatePicker显示的语言.// 1.跟踪所有可用的地区,取出想要的地区    NSLog(@"%@", [NSLocale availableLocaleIdentifiers]);    // 2. 设置日期选择控件的地区[datePicker setLocale:[[NSLocalealloc]initWithLocaleIdentifier:@"zh_Hans_CN

IOS开发UI基础UIPikerView的属性

UIPikerView的属性 1. numberOfComponents:返回UIPickerView当前的列数NSInteger num = _pickerView.numberOfComponents;NSLog( @"%d", num); 2. - (NSInteger)numberOfRowsInComponent:(NSInteger)component; 返回component列中有多少行.NSInteger numInCp = [_pickerView numberOfR

IOS开发UI基础UITextView相关属性

UITextView相关属性 •    text: 设置textView中文本_textView.text = @"Now is the time for all good developers to come to serve their country.\n\nNow is the time for all good developers to come to serve their country."; // 设置它显示的内容    •    font:设置textView中文字

IOS开发UI基础UIPageControl的属性

UIPageControl    •    numberOfPages // 设置有多少页 默认为0// 2) 设置页数   [pageControl setNumberOfPages:kImageCount];    •    currentPage  // 设置当前页[pageControl setCurrentPage:0]; •    pageIndicatorTintColor // 设置页码指示器颜色 [pageControl setPageIndicatorTintColor:[U

iOS开发UI基础—transframe属性(形变)

iOS开发UI基础-transframe属性(形变) 1. transform属性 在OC中,通过transform属性可以修改对象的平移.缩放比例和旋转角度 常用的创建transform结构体方法分两大类 (1) 创建"基于控件初始位置"的形变 CGAffineTransformMakeTranslation(平移) CGAffineTransformMakeScale(缩放) CGAffineTransformMakeRotation(旋转) (2) 创建"基于trans