UI
文章平均质量分 77
_tian_qian
这个作者很懒,什么都没留下…
展开
-
UILabel
UILabel的常用方法UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100, 200, 200, 50)];//设置内容label.text = @"我是一个label";//设置背景颜色label.backgroundColor = [UIColor orangeColor];//设置文字对齐方式label.tex原创 2016-11-04 16:11:07 · 141 阅读 · 0 评论 -
UIScrollView
UIScrollView常用方法(void)viewDidLoad { [super viewDidLoad];// Do any additional setup after loading the view, typically from a nib. UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRect原创 2016-11-05 15:03:13 · 176 阅读 · 0 评论 -
UITableView常用方法
UITableView(void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib.//编辑按钮 self.navigationItem.rightBarButtonItem = [[UIBarButtonItem al原创 2016-11-05 15:15:49 · 204 阅读 · 0 评论 -
UISearchController
UISearchController常用方法没有SearchResultsController(void)createSearchController { //参数代表搜索结果哪个控制器显示 //nil 当前视图控制器显示 _searchVC = [[UISearchController alloc] initWithSearchResultsController:n原创 2016-11-05 15:56:13 · 180 阅读 · 0 评论 -
iOS自定义控制器侧滑半屏显示
自定义侧滑半屏显示-(id)initWithLeftVC:(UIViewController )leftVC mainVC:(UIViewController )mainVC rightVC:(UIViewController *)rightVC { self = [super init];if(self){ [self.view addSubview:leftVC.view]原创 2016-11-08 09:37:07 · 1327 阅读 · 0 评论 -
UISplitViewController
UISplitViewController只能用于iPad上(void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib.//系统写好一个事件响应的对象 以及事件响应的方法 self.navigationItem.leftBarB原创 2016-11-08 10:10:23 · 327 阅读 · 0 评论 -
UIPopoverController
UIPopoverController只能跑在iPad上(IBAction)click:(id)sender; @property (nonatomic,strong) UIPopoverController *popOver;@end@implementation ViewController(void)viewDidLoad { [super viewDidLoad]; // Do原创 2016-11-08 09:57:55 · 159 阅读 · 0 评论 -
MasonryDemo
UIView *view = [[UIView alloc] init];view.backgroundColor = [UIColor redColor];[self.view addSubview:view];/* make.top.mas_equalTo(self.view.mas_top).with.offset(10); make.left.mas_equalTo(self.view原创 2016-11-08 14:28:43 · 206 阅读 · 0 评论 -
NSMutableAttributedString富文本
富文本的实现(NSMuttableAttstring/NSMutableAttributedString)设置段落 1.NSMutableParagraphStyle 行间距 @property(NS_NONATOMIC_IOSONLY) CGFloat lineSpacing; 段落与段落之间的间距 @property(NS_NONATOMIC_IOSONLY) CGFloat para原创 2016-11-08 15:54:48 · 255 阅读 · 0 评论 -
UILocalNotification本地推送
//获取推送权限UIUserNotificationType type = UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound; UIUserNotificationSettings *settings = [UIUserNotificationSettin原创 2016-11-08 16:30:22 · 280 阅读 · 0 评论 -
自定义tabBar
//CustomTabbarController@interface CustomTabbarController : UITabBarController(void)viewDidLoad { [super viewDidLoad];//1.隐藏系统的tabbar //系统tabbar高度49 self.tabBar.hidden = YES;//2.自定义tabbar self.cust原创 2016-11-05 14:53:44 · 172 阅读 · 0 评论 -
UINavigationController
AppDelegate(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions { // Override point for customization after application launch. self.window = [[UI原创 2016-11-05 14:22:35 · 161 阅读 · 0 评论 -
UITouch
ViewController-UITouch//触摸开始 - (void)touchesBegan:(NSSet )touches withEvent:(UIEvent )event { //获取坐标信息 //获取到触摸点 UITouch *touch = [touches anyObject];//转化为当前视图的具体坐标CGPoint point = [tou原创 2016-11-05 10:57:51 · 180 阅读 · 0 评论 -
UIButton
UIButton的常用方法//初始化一个button按钮/* UIButtonTypeCustom = 0, // no button type UIButtonTypeSystem NS_ENUM_AVAILABLE_IOS(7_0), // standard system button UIButtonTypeDetailDisclosure原创 2016-11-04 16:44:38 · 172 阅读 · 0 评论 -
UIImageView
UIImageView的常用方法UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 200, 100, 200)];imgView.backgroundColor = [UIColor redColor];//设置图片imgView.image = [UIImage imageNamed:@"psb原创 2016-11-04 18:21:45 · 208 阅读 · 0 评论 -
UIView的层次关系
//添加子视图UIView *fatherView = [[UIView alloc] initWithFrame:CGRectMake(100, 200, 200, 200)];fatherView.backgroundColor = [UIColor redColor];[self.view addSubview:fatherView];//子视图1 绿色UIView *sonView =原创 2016-11-04 18:27:11 · 308 阅读 · 0 评论 -
UIView的简单动画
UIView的简单动画//方法1//设置简单动画//1.开始动画[UIView beginAnimations:nil context:nil];//2.持续时间[UIView setAnimationDuration:2.0];//3.动画效果fatherView.center = CGPointMake(self.view.frame.size.width / 2, self.view.原创 2016-11-04 18:36:49 · 188 阅读 · 0 评论 -
UITextField
UITextField的常用方法UITextField *textF = [[UITextField alloc] initWithFrame:CGRectMake(100, 200, 200, 40)];//键盘弹出 Hardward -》keyboard -》Toggle//边框样式textF.borderStyle = UITextBorderStyleRoundedRect;[self.原创 2016-11-05 09:52:43 · 170 阅读 · 0 评论 -
UIViewController
UIViewController的生命周期及跳转模式(instancetype)init { self = [super init]; if (self) { NSLog(@”Root:2.构造方法”); } return self; }(void)loadView { [super loadView]; NSLog(@”Root:3视图正在加载中。。。”); }原创 2016-11-05 09:57:16 · 140 阅读 · 0 评论 -
UINavigationBar
UINavigationBar的常用方法self.view.backgroundColor = [UIColor whiteColor];//设置navigationBar的背景图片// [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@”map”] forBarMetrics:原创 2016-11-05 10:07:28 · 166 阅读 · 0 评论 -
UINavigationItem
UINavigationItem的常用方法(void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.view.backgroundColor = [UIColor whiteColor];//通过文字设置导航条左边原创 2016-11-05 10:21:25 · 215 阅读 · 0 评论 -
iOS常用UI控件
UISegmentedControl(void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.view.backgroundColor = [UIColor whiteColor];UISegmentedControl *segement = [[UISeg原创 2016-11-05 10:51:30 · 426 阅读 · 0 评论 -
手动布局&自动布局子视图
重新布局子视图的情景 点击父视图放大时,子视图的布局并未发生相应的改变,此时需要重新布局子视图。(如下图所示) iOS子视图重新布局分为手动布局和自动布局两种方式。 手动布局主要是通过重写layoutSubviews来实现,而自动布局主要通过设置视图的autoresizingMask属性来实现子视图的重新布局。原视图 未重新布局子视图点击放大时 重新布局子视图点击放大时 手动布局子原创 2016-12-30 16:06:58 · 533 阅读 · 0 评论