07 2012 档案

隐藏UITableView空Cell的Separator Lines
摘要:UITableView加载的时候,会碰到cell的数量不能填满整个屏幕,这个时候,屏幕上会显示空的cell的分隔线,很不爽,解决的方法有2个,一种是自定义cell,然后设置tableview的separatorStyle为UITableViewCellSeparatorStyleNone,还有一种方法是定义一个空的UIView,然后将这个UIView设置为tableview的footer,这样就搞定了。两种方式的代码分别如下1 myTableView.separatorStyle = UITableViewCellSeparatorStyleNone2 UIView *footer =[[UI 阅读全文

posted @ 2012-07-22 20:03 肖春锋 阅读(1391) 评论(0) 推荐(0)

关于Reachability获取网络状态
摘要:今天和同事讨论关于Reachability获取是否连接wifi的问题,经真机测试,试验结果真是令我觉得很困惑。 在1.5版本下: kReachableViaWWAN 表示3G,kReachableViaWiFi 表示wifi。 可是在2.0版本下则反之: kReachableViaWWAN 表示wifi,kReachableViaWiFi 表示3G。 我觉得官方不会犯这样文字上的错误,也不会升级时不考虑向下兼容。所以记下,有时间的时候好好研究一下。 阅读全文

posted @ 2012-07-13 21:03 肖春锋 阅读(289) 评论(0) 推荐(0)

获取设备方向
摘要://获得设备方向 UIInterfaceOrientationorientation = [[UIApplicationsharedApplication]statusBarOrientation]; //程序启动时获取当前驱动的方向的方法 [[UIDevicecurrentDevice]beginGeneratingDeviceOrientationNotifications]; UIDeviceOrientationcurrentOrientation = [ [UIDevicecurrentDevice]orientation]; [[UIDevicecurrentDevice]... 阅读全文

posted @ 2012-07-12 19:55 肖春锋 阅读(172) 评论(0) 推荐(0)

导航