原创 iOS9不能正常使用HTTP的解決方法
在工程info.plist文件下添加App Transport Security Settings,類型爲Dictionary 然後在App Transport Security Settings下面添加Allow Arbitrary L
原创 xib中設置view的圓角
要在xib中添加一個圓角的view, 網上查了一下, 有的寫的是layer.corner.radius, 正確的應該是layer.cornerRadius, 類型是number
原创 iOS8使用CoreLocation獲取當前地理位置
1.導入CoreLocation.framework框架 #import <CoreLocation/CoreLocation.h> 2.定義CLLocationManager類型的屬性 @property (strong, nonat
原创 當前界面隱藏navigationbar後動畫出現白條
<p>// 調用以下方法即可</p>self.navigationController setNavigationBarHidden:YES animated:YES];
原创 UIButton左文字右圖片
// 在setTitle之後加入以下這句, 否則iOS8中會重疊 [leftButton layoutIfNeeded]; leftButton.imageEdgeInsets = UIEdgeInsetsM
原创 iOS UILabel指定文字變顏色
示例: 共有100個商品, 數字顯示紅色 UILabel *testLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 40)]; [self.view addSu