UI控件 点滴
文章平均质量分 73
AppleWiner
广东本科大学生,自学ios开发,梦想有一天能开发一个很牛逼的APP……
展开
-
【UITextField与UITextView】
//创建文本框对象及大小 只能是单行的 (已在AppDelegate.h中对t提升权限UITextField *t) t=[[UITextField alloc]initWithFrame:CGRectMake(85, 70, 170,40)]; t.backgroundColor=[UIColor greenColor]; //设置文字方向原创 2015-08-12 23:22:26 · 410 阅读 · 0 评论 -
【使用Property创建存取器】
使⽤用@Property创建存取器使⽤用@Property创建存取器// Car.h#import @interface Car : NSObject{// 实例变量NSString *carName; NSString *carType;}@property(nonatomic,strong) NSString *carName;@property(no原创 2015-08-06 12:46:37 · 447 阅读 · 0 评论 -
【UIActivityIndicator活动指示器控件】
//创建活动指示控件及大小 act=[[UIActivityIndicatorViewalloc]initWithFrame:CGRectMake(40,40, 40, 40)]; //默认是停止时不显示(yes) act.hidesWhenStopped=NO; //设定他的样式 act.activityIndic原创 2015-09-16 21:01:12 · 579 阅读 · 0 评论 -
【UIDatePicker日期选择器控件】
/*@interface AppDelegate :UIResponder UIApplicationDelegate>{ UIDatePicker *dp;}提升权限*/ //创建日期选择器控件 dp=[[UIDatePickeralloc]initWithFrame:CGRectMake(00,50, 320, 200原创 2015-09-25 11:16:08 · 625 阅读 · 0 评论 -
【UIProgressView进度条控件】
//创建进度条控件 progress=[[UIProgressViewalloc]initWithFrame:CGRectMake(0,40, 320,1)]; //设置进度条轨迹颜色相当于背景颜色 progress.trackTintColor=[UIColorblackColor]; //设置进度条颜色原创 2015-09-07 10:13:29 · 525 阅读 · 0 评论 -
【UIAlertView警报和UIActionSheet操作表】
/*@interface AppDelegate :UIResponder UIApplicationDelegate,UIAlertViewDelegate,UIActionSheetDelegate>代理*/ //创建两按钮及其目标 UIButton *b1=[[UIButtonalloc]initWithFrame:CGRectMake(30,60,原创 2015-10-16 15:38:04 · 607 阅读 · 0 评论 -
【UIViewController视图控制器】
#import "ViewController.h"#import "otherViewController.h"//导入@interface ViewController ()@end@implementation ViewController//加载视图内存 一定要用父类的加载视图初始化 不然会一直加载内存 知道崩溃原创 2015-10-23 15:04:45 · 571 阅读 · 0 评论 -
【UIViewController界面传值】
AppDelegate.m#import "AppDelegate.h"#import "ViewController.h"@interface AppDelegate ()@end@implementation AppDelegate- (BOOL)application:(UIApplication *)applica原创 2015-10-23 15:09:26 · 505 阅读 · 0 评论 -
【UIPickerView自定义选择器控件】
/*@interface AppDelegate :UIResponder UIApplicationDelegate,UIPickerViewDataSource,UIPickerViewDelegate>//协议@property (strong,nonatomic) UIWindow *window;@property(strong,nonatomic)N原创 2015-10-12 19:57:58 · 852 阅读 · 0 评论 -
【 UIImageView图片控件】
/*@interface AppDelegate : UIResponder UIApplicationDelegate>{ UIImageView *iv; UIImage *ima; BOOL flag;}以提升权限*/ //创建一个图片视图对象 用来显示图片(被即将创建的图片覆盖) iv=[[UIIma原创 2015-09-24 22:38:32 · 488 阅读 · 0 评论 -
【UILabel和UIButton】
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window=[[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]];原创 2015-08-05 13:46:02 · 395 阅读 · 0 评论 -
【UISegmentedControl】
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window=[[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]];原创 2015-08-12 23:20:17 · 349 阅读 · 0 评论 -
【UISlider滑动控件】
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window=[[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]];原创 2015-08-27 17:18:04 · 501 阅读 · 0 评论 -
【UISwitch开关控件】
//已在AppDelegate.h中对sw,sw1提升权限 UISwitch *sw;UISwitch *sw1; //创建开关控件 系统会自动帮你决定最佳的尺寸,自己写的尺寸会被忽略掉,你只要定义好相对父视图的位置就好 sw=[[UISwitch alloc]initWithFrame:CGRectMake(20, 30, 300, 200)]; //值原创 2015-08-14 13:40:21 · 434 阅读 · 0 评论 -
【@property的特性】
@property还有⼀一些关键字,它们都是有特殊作⽤用的,⽐比如上述代码中的nonatomic,strong:@property(nonatomic,strong) NSString *carName;@property(nonatomic,strong) NSString *carType;我把它们分为三类,分别是:原⼦子性,存取器控制,内存管理。一、原⼦子性a原创 2015-08-06 12:51:34 · 532 阅读 · 0 评论