ios开发问题汇总

1、设置屏幕亮度:

[[UIScreen mainScreen] setBrightness: Value];value的值在0-1之间

2、对WebView的HTML进行修改

其他html属性重载和此方法类似; 
参考网址: 
(stringByEvaluatingJavaScriptFromString的使用方法)http://www.uml.org.cn/mobiledev/201108181.asp   
( iphone 获取UIWebView内Html方法)http://blog.csdn.net/diyagoanyhacker/article/details/6564897 
(IOS UIWebView引用外部CSS样式)http://hi.baidu.com/jwq359699768/item/780879e5c98bfb3e4ddcaf22

取消第一相应

可以给一个View添加一个uicontrol

ios开发中各种系统控件高度

导航栏  横屏32pix 竖屏 44pix 

状态栏 20pix

工具栏 49pix

分栏控制器 49pix


iOS9网络请求用到session会报下面的错

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. 

解决办法:

在app的info.Plist中增加

  1. 添加 NSAppTransportSecurity 类型 Dictionary ;
  2. 在 NSAppTransportSecurity 下添加 NSAllowsArbitraryLoads 类型Boolean ,值设为 YES;
即可。


一个非常好的学习网站

https://github.com/ipader/SwiftGuide


出现这种错误:Cannot use '@try' with Objective-C exceptions disabled

只需要将build settings里面的Enable Objective-C Exceptions设置成YES即可。

顺便说明一点,在iOS开发中虽然提供try catch,但是尽可能的不用try catch,

因为在iOS开发中,OC提供了NSError和NScatchException方法来获取错误,而try catch相对于以上方法来说效率低下。不推荐使用!


照相机的显示方向改变,可以通过相机的cameraViewTransform属性进行修改。如

pickerController.cameraViewTransform = CGAffineTransformMakeRotation(-M_PI/2);

pickerController.cameraViewTransform = CGAffineTransformScale(pickerController.cameraViewTransform, 1, 1);

pickerController.cameraViewTransform = CGAffineTransformTranslate(pickerController.cameraViewTransform, screenBounds.height, 0);


用代码创建空工程,根视图上下出现黑边

这是因为没有launchImage造成的


猜你喜欢

转载自blog.csdn.net/cjh965063777/article/details/47681667