随笔分类 -  UI

IOS-UI
摘要:iOS 控制单个控制器旋转控制单个ViewController 的旋转//不旋转,保持竖屏//iOS 5- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{ ... 阅读全文
posted @ 2015-09-22 10:27 cocoajin 阅读(730) 评论(0) 推荐(0) 编辑
摘要:UIButton 一个控件 实现 左图标右文本的效果如图,我们要实现一个 左边图标右边文本的效果,一般 可以考虑是 UIImageView + UILabel不过,其实一个UIButton就可以搞定了代码: UIButton *tBtn = [UIButton buttonWithType:U... 阅读全文
posted @ 2014-11-27 14:18 cocoajin 阅读(998) 评论(0) 推荐(0) 编辑
摘要:iOS 使用drawRect: 绘制虚线椭圆1:首先如果要使用 drawRect 绘图 要导入CoreGraphics.framework 框架 然后 创建 自定义view, 即是 myView继承 UIView;2: 重写- (void)drawRect:(CGRect)rect方法;3:添加... 阅读全文
posted @ 2014-07-24 14:14 cocoajin 阅读(3022) 评论(0) 推荐(0) 编辑
摘要:iOS 设置UILabel 的内边距- (void)drawTextInRect:(CGRect)rect { UIEdgeInsets insets = {0, 5, 0, 5}; [super drawTextInRect:UIEdgeInsetsInsetRect(rect, in... 阅读全文
posted @ 2014-05-13 14:32 cocoajin 阅读(18927) 评论(2) 推荐(0) 编辑
摘要:uitabbar 标题设置 button text attributes only respected for UIControlStateNormal [[UITabBarItem appearance] setTitleTextAttributes:@{ UITextAttributeTextColor : [UIColor whiteColor] } forState:UIControlStateSelected];设置 tabbar 标题时,出现提示button text attributes... 阅读全文
posted @ 2014-04-01 14:40 cocoajin 阅读(1568) 评论(0) 推荐(0) 编辑
摘要:MPMoviePlayerViewController 视频播放黑屏今天用视频做本地视频播放;使用MPMoviePlayerViewController 老是出现黑屏;结果发现是一个 很坑爹的问题;那就是 在 controller里面要有一个属性MPMoviePlayerViewController *player;.h文件@property (nonatomic,retain)MPMoviePlayerViewController *videoPlayer; .m文件 self.videoPlayer = [[MPMoviePlayerViewController alloc] ini... 阅读全文
posted @ 2014-03-05 11:20 cocoajin 阅读(1247) 评论(0) 推荐(0) 编辑
摘要:iOS 状态栏和导航条配置一:隐藏: [self.navigationController setNavigationBarHidden:YES animated:YES]; [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:YES];二:状态值参考:http://beyondvincent.com/blog/2013/11/03/120-customize-navigation-status-bar-ios-7/http://book.51cto.com/ar... 阅读全文
posted @ 2014-01-26 15:43 cocoajin 阅读(262) 评论(0) 推荐(1) 编辑
摘要:iOS 去掉tabaar上面的 一条线利用一个 1像素高的图片[[UITabBar appearance] setShadowImage:[UIImage imageNamed:@"transparentShadow.png"]];参考:http://stackoverflow.com/questions/14371343/ios-uitabbar-remove-top-shadow-gradient-line 阅读全文
posted @ 2014-01-24 16:42 cocoajin 阅读(550) 评论(0) 推荐(0) 编辑
摘要:iOS tabbar 图片,最佳大小方式文档大小 30 *30retaina 60 *60最佳大小 48 *32参考:http://stackoverflow.com/questions/151746/iphone-tab-bar-item-image-resolution 阅读全文
posted @ 2014-01-18 10:29 cocoajin 阅读(2232) 评论(0) 推荐(0) 编辑
摘要:UISegmentedControl 修改字体大小 和 颜色大小: UIFont *font = [UIFont boldSystemFontOfSize:14.0f]; NSDictionary *attributes = [NSDictionary dictionaryWithObject:font forKey:UITextAttributeFont]; [sortListSeg setTitleTextAttributes:attributes ... 阅读全文
posted @ 2014-01-16 21:36 cocoajin 阅读(10115) 评论(0) 推荐(0) 编辑
摘要:一:在同一个view上加载,UITapGestureRecognizer手势,UIButton 行为,UITabelView点击事件冲突;二:解决方式: 在UITapGesttureRecognizer的手势的代理UIGestureRecognizerDelegate里面屏蔽上面的冲突事件三:如代码: //处理键盘取消 UITapGestureRecognizer *resinTheInput = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(resignTheInPuts)]; re... 阅读全文
posted @ 2014-01-07 10:07 cocoajin 阅读(4518) 评论(0) 推荐(0) 编辑
摘要:TableViewCell多选;CheckBox;- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (!cell) { cell = [[... 阅读全文
posted @ 2013-12-30 15:52 cocoajin 阅读(1145) 评论(0) 推荐(0) 编辑
摘要:一:iOS6.0及以后:下拉刷新控件UIRefreshControlTableView属性:refreshControl二:使用 1 - (void)colseTheTB 2 { 3 [self dismissViewControllerAnimated:YES completion:nil]; 4 } 5 6 - (void)viewDidLoad 7 { 8 [super viewDidLoad]; 9 10 self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithBarBut... 阅读全文
posted @ 2013-12-25 14:33 cocoajin 阅读(662) 评论(0) 推荐(0) 编辑
摘要:在此有一个webView默认是打开 百度的页面;设置代理,并在代理中处理- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType 1 - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNaviga 阅读全文
posted @ 2013-12-18 16:25 cocoajin 阅读(1156) 评论(0) 推荐(0) 编辑
摘要:在iOS上,使用系统Mapkit定位,获取到的坐标会有偏移;今有需求,用系统Mapkit定位,并Regcode出实际地理位置,修正偏移;解决方案: 使用MapView的代理- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation NS_AVAILABLE(10_9, 4_0);获取坐标,然后根据这个坐标解码出实际地址就行了!大致流程:导入MapKit框架,并在使用时,引入:mapkit初始化一个mapView ,并showUserLocation self.theMapVi 阅读全文
posted @ 2013-12-10 12:47 cocoajin 阅读(941) 评论(0) 推荐(0) 编辑
摘要:应用CLLocationManager 的两个方法[CLLocationManagerlocationServicesEnabled] 判断设备是否开启定位功能[CLLocationManagerauthorizationStatus] 判断设备是否允许本程序的定位服务- (BOOL)isOnLocation{ BOOL isOn = false; if (([CLLocationManager locationServicesEnabled]) && ([CLLocationManager authorizationStatus] == kCLAuthorizationSta 阅读全文
posted @ 2013-11-13 09:51 cocoajin 阅读(486) 评论(0) 推荐(0) 编辑
摘要:#pragma mark ------------ searchBar 代理方法 --------------------------- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{ /**< 模糊查找*/ NSPredicate *predicateString = [NSPredicate predicateWithFormat:@"%K contains[cd] %@", @"name", searchText]; self.sea 阅读全文
posted @ 2013-11-11 14:23 cocoajin 阅读(967) 评论(0) 推荐(0) 编辑
摘要:在iOS7 下测试了一些方法,发现还是攺变不了文本的居左,最后发现了一个nb的招; _searchBar = [[UISearchBar alloc]initWithFrame:CGRectZero]; if (kiOS7) { _searchBar.placeholder = @"请输入您所在的城市 "; } else { _searchBar.placeholder = @"请输入您所在的城市"; }看到上面的ios7下配置没,后面加了一堆的空格!哈哈http:/... 阅读全文
posted @ 2013-11-07 17:02 cocoajin 阅读(2470) 评论(0) 推荐(0) 编辑
摘要:主要是在 UISearchDisplayDelegate中更改;- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller{ [_searchBar setShowsCancelButton:YES animated:NO]; if (kiOS7) { for (UIView *subView in [[_searchBar.subviews objectAtIndex:0] subviews]){ if([subView isKin... 阅读全文
posted @ 2013-11-07 16:00 cocoajin 阅读(1576) 评论(0) 推荐(0) 编辑
摘要:UISlider 设置增量 UISlider *slier = [[UISlider alloc]initWithFrame:CGRectMake(wu500.right, 0, 210, 50)]; slier.minimumValue = 500; slier.maximumValue = 4000; slier.thumbTintColor = [UIColor redColor]; [self.view addSubview:slier]; [slier addTarget:self action:@selector(sliderValueChang... 阅读全文
posted @ 2013-11-07 11:02 cocoajin 阅读(364) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示