摘要: UIView常用方法addSubView: // 添加子视图insertSubview: atIndex // 视图插入到指定索引位置insertSubview:aboveSubview: // 视图插入指定视图之上insertSubview:belowSubview: // 视图插入指定视... 阅读全文
posted @ 2015-05-20 15:05 wb145230 阅读(235) 评论(0) 推荐(0) 编辑
摘要: @interface ViewController () { UIView *animationView; UIButton *button; CGPoint animationPoint;}@end初始化button和动画的view- (void)viewDidLoad { ... 阅读全文
posted @ 2015-05-14 11:43 wb145230 阅读(13870) 评论(0) 推荐(0) 编辑
摘要: 在adapter的getView方法中进行设置,代码如下@Overridepublic View getView(int position, View convertView, ViewGroup parent) { //省略相关代码 //可以根据position对某Item进行高度... 阅读全文
posted @ 2015-05-02 14:24 wb145230 阅读(4047) 评论(0) 推荐(0) 编辑
摘要: 本文介绍一下自定义行间距的UILabel的高度如何获取,需要借助一下开源的UILabel控件:TTTAttributedLabel附下载地址https://github.com/TTTAttributedLabel/TTTAttributedLabel下载后,添加到工程里面,导入头文件 #impor... 阅读全文
posted @ 2015-04-28 23:33 wb145230 阅读(3493) 评论(2) 推荐(0) 编辑
摘要: 适用于iOS6以后NSString *tip = @"UILable高度自适应,UILable高度自适应,UILable高度自适应";UILabel label_2 = [[UILabel alloc] initWithFrame:CGRectMake(20, 100, 200, 30)];labe... 阅读全文
posted @ 2015-04-24 19:47 wb145230 阅读(624) 评论(0) 推荐(0) 编辑
摘要: 1.第一种方法声明block:- (void)test:(int) param_1 completion:(void(^)(int)) completion;实现block:-(void)test:(int)param_1 completion:(void (^)(int))completion {... 阅读全文
posted @ 2015-04-23 17:48 wb145230 阅读(335) 评论(0) 推荐(0) 编辑
摘要: 子线程的使用方法:dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ //子线程的处理逻辑 });DISPATCH_QUEUE_PRIORITY_DEFAULT 代表队列的优先级,... 阅读全文
posted @ 2015-04-22 11:42 wb145230 阅读(1014) 评论(0) 推荐(0) 编辑
摘要: NSInteger couter = 0;while (self.aa == nil && couter < 10) { NSLog(@"aa为空,阻塞不去构造JSON字典"); couter++; //每隔一秒检查一下aa是否为空,最多尝试10次. [[NSRunLoo... 阅读全文
posted @ 2015-04-15 10:47 wb145230 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 原因是在A里面继承了B类里面的"XXDelegate",在B类的头文件里又导入了A类的头文件解决方法不在B类的头文件导入A类的头文件,改成在B类的.m文件导入A类的头文件 阅读全文
posted @ 2015-04-09 16:38 wb145230 阅读(1223) 评论(0) 推荐(0) 编辑
摘要: 导入以下头文件#include #include 通过下面方法即可获取ip地址+ (NSString *)getIpAddress { NSString *address = @"error"; struct ifaddrs *interfaces = NULL; struct i... 阅读全文
posted @ 2015-04-02 13:53 wb145230 阅读(343) 评论(3) 推荐(0) 编辑