
OC
小码哥科技
学而不耻下问。
展开
-
ios获取和设置系统音量
亲测ios6-ios8都可以,通用方法如下:(float) getVolume { MPVolumeView * slide=[MPVolumeView new]; UISlider * volumeViewSlider; for(UIView *view in[slide subviews]) { if([[[view class] description] isEqualT原创 2016-06-07 15:45:12 · 2534 阅读 · 1 评论 -
OC通过对象找到对象所在的类
废话不多说,直接上代码:xxx * xx=[[xxx alloc] init];[NSString stringWithUTF8String:object_getClassName(xx)];我们可以通过上述语句获取这个对象的所属类名。原创 2016-06-07 15:51:48 · 573 阅读 · 0 评论 -
UITableView 防止touch被吃掉
//防止cell上的事件被截获 UITableView 防止touch被吃掉(BOOL)gestureRecognizer:(UIGestureRecognizer )gestureRecognizer shouldReceiveTouch:(UITouch )touch { // 输出点击的view的类名 NSLog(@”%@”, NSStringFromClass([touch.vi原创 2016-06-07 15:54:33 · 577 阅读 · 0 评论 -
IOS遍历未知对象属性、函数
/* 获取对象的所有属性 */(NSDictionary *)properties_aps { NSMutableDictionary *props = [NSMutableDictionary dictionary]; unsigned int outCount, i; objc_property_t *properties = class_copyPropertyList([self原创 2016-06-07 15:59:23 · 691 阅读 · 0 评论 -
OC 设置APP屏幕常亮
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];//不允许休眠哈哈,就这一句搞定。原创 2016-06-07 16:01:14 · 2004 阅读 · 0 评论 -
UIScrollView 用法详解
属性:contentOffset: 用来表示UIScrollView滚动的位置(其实就是内容左上角scrollView左上角的间距值)contentSize:用来表示UIScrollView内容的尺寸,滚动范围contentInset:能够在UIScrollView的4周添加额外的滚动区域,一般用来避免scrollView的其他控件挡住scrollEnabled:设置scrollView以及其它内部原创 2016-06-07 16:53:16 · 604 阅读 · 0 评论 -
UIButton 字体颜色 粗体
UIButton * btn=[[UIButton alloc] initWithFrame:CGRectMake(5, 5,50,30)];[btn setTitle:@"xxx" forState:UIControlStateNormal];btn.backgroundColor=YYColor(247, 247, 247);[btn setTitleColor:YYColor(234,原创 2016-06-07 17:10:15 · 5195 阅读 · 0 评论