UIView有个UIViewContentMode类型的属性contentMode,可以通过它来修改视图的内容显示模式。
typedef NS_ENUM(NSInteger, UIViewContentMode) {
UIViewContentModeScaleToFill,
UIViewContentModeScaleAspectFit, // contents...
分类:
其他好文 时间:
2015-04-24 19:22:09
阅读次数:
229
NSInteger selectIndex = [NSIndexPath indexPathForItem:0 inSection:0];[self.ui_tableView selectRowAtIndexPath:selectIndex animated:YES scrollPosition:U...
分类:
移动开发 时间:
2015-04-24 19:00:56
阅读次数:
236
4-22 学习心得// 设置每组尾部View- (UIView *) tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section// 设置每组头部View- (UIView *) tableView:(UI...
分类:
其他好文 时间:
2015-04-23 19:47:05
阅读次数:
166
如果不加同步锁,代码如下:#import"ViewController.h"@interfaceViewController(){NSInteger_money;}@end@implementationViewController- (void)viewDidLoad { [superviewDid...
分类:
编程语言 时间:
2015-04-23 01:56:40
阅读次数:
146
在iOS开发中经常使用NSInteger和NSUInteger,而在其他的类似于C++的语言中,我们经常使用的是int、unsigned int。我们知道iOS也可以使用g++编译器,那么它们之间是否有什么联系呢?从NSUInteger和NSInteger的定义文件中NSObjCRuntime.h发...
分类:
移动开发 时间:
2015-04-22 13:42:44
阅读次数:
177
比如车票类Ticket,保证票只创建了一次。1.定义静态全局变量 static Ticket *SharedInstance;定义一个票数的变量 @property(assign,atomic)NSInteger tickets;atomic 原子属性,在多线程中一个线程访问了其他线程不能访问了。另...
分类:
移动开发 时间:
2015-04-22 13:13:21
阅读次数:
128
NSUserDefaults做数据存储也是比较常用,适合轻量级的本地数据存储,读取也很方便。一、支持的数据类型如下图(NSString、NSArray、NSDictionary、NSData、NSInteger、float、double、BOOL、NSURL)二、使用Demo
分类:
其他好文 时间:
2015-04-21 20:01:48
阅读次数:
138
1.隐藏UITableViewCell的分隔线[self.myTableViewsetSeparatorStyle:UITableViewCellSeparatorStyleNone];UITableViewCellSeparatorStyle有如下几种typedefNS_ENUM(NSInteger,UITableViewCellSeparatorStyle){UITableViewCellSeparatorStyleNone,UITableViewCellSeparatorStyle..
分类:
移动开发 时间:
2015-04-21 14:56:13
阅读次数:
118
- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight 这个函数是UIImage的一个实例函数,它的功能是创建一个内容可拉伸,而边角不拉伸的图...
分类:
其他好文 时间:
2015-04-17 13:38:33
阅读次数:
97
RainBow.m
#import "RainBow.h"
@implementation RainBow
{
NSArray * _colorArray;
}
-(instancetype)initWithFrame:(CGRect)frame withNum:(NSInteger)
num{...
分类:
其他好文 时间:
2015-04-16 20:01:29
阅读次数:
120