主要是在将图像引入项目中,没有选择Destination:Copy items if needed一项. 没有选择Destination:Copy items if needed一项,图像只能是以链接的形式存在于项目中,当图像移动路径时,项目中的图像就无法正常显示. 所以,以后只要把其他资源引进项目中,都要勾选这一项,即将资源复制一份放进项目中,而不是以链接的形式存在于项目中.…
UIButton *testButton = [UIButton buttonWithType:UIButtonTypeSystem]; [testButton setFrame:CGRectMake(self.view.frame.size.width/2, self.view.frame.size.height/2, 100, 100)]; [testButton setTitle:@"获取屏幕尺寸" forState:UIControlStateNormal]; [testBut…
mini-width:设置元素的最小宽度.該屬性值會對元素的寬度設置一個最小限制.因此,元素可以比制定值寬,但不能比制定值窄.不允許指定負值. 完美的居中佈局: body{text-align: center; mini-width: 760px;} #wrapper{text-align: left; margin:0 auto; width:750px;} mini-width IE並不認識,這是爲老瀏覽器準備的,只要這個值比實際的頁面打就ok了. 讓一個元素的css樣式的一個屬性無效在其前…
这里将UIKit的外观属性及方法从头文件中抽取出来,以便查找及熟悉.(更新到iOS 8.0,从A-Z排序) UIActivityIndicatorView @property (readwrite, nonatomic, retain) UIColor *color NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR; UIBarButtonItem // 背景图片相关 - (UIImage *)backgroundImageForState:(UICont…
创建UIImage的方法有两种: UIImage *image = [UIImageimageNamed:@"image.jpg"];//这种不释放内存,要缓存 NSString *path = [[NSBundlemainBundle]pathForResource:@"image"ofType:@"jpg"]; UIImage *image1 = [UIImageimageWithContentsOfFile:path];//这种会释放内存…
1.它用于UITextView和UIWebView,属性名为:dataDetetorTypes 2.此属性可以设定使符合电话.邮件.网址.符合格式的日期等文字变为链接文字. 3.电话号码点击后拨出电话,网址点击后会用Safari打开,电子邮件会用mail打开,而符合格式的日期会弹出一个ActionSheet,有创建事件,在Calendar中显示,和拷贝三个选项. 4.使用示例: UITextView *textView = [[UITextView alloc] initWithFrame:CG…
一.输出口 1.一旦在故事板中对某控件或者视图定义了输出口,不需要再在文件中对它们进行初始化.否则,会产生错误.…
一.Cell的设置 1.设置cell的背景view和选中时的背景view UIImageView *bg = [[UIImageView alloc] init]; bg.image = [UIImage imageNamed:@"abc.png"]; cell.backgroundView = bg; UIImageView *selectedBg = [[UIImageView alloc] init]; selectedBg.image = [UIImage imageNamed…
//例如: UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; button.frame = CGRectMake(50,50,100,40); button.backgroundColor = [UIColor blueColor]; //关键语句 button.layer.cornerRadius = 2.0;//2.0是圆角的弧度,根据需求自己更改 button.layer.borderColor = [UICo…
for (NSString *fontFamily  in [UIFont familyNames]) { NSLog(@"字体家族是:%@",fontFamily); for(NSString *fontName in [UIFont fontNamesForFamilyName:fontFamily]) { NSLog(@"\t%@",fontName); } }…