父视图设置alpha属性后,加在其中的子视图受影响?
2014-06-21 22:36
309 查看
父视图设置alpha属性后,加在其中的子视图受影响?
首先了解设置背景色透明样式的方法有两种
方法1、直接设置视图的背景颜色
[xxView setBackgroundColor:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0]];
方法2、设置视图的layer层背景色
[xxView.layer setBackgroundColor:[UIColor blackColor].CGColor];
[xxView setAlpha:0.8];
其次,不是非常好的解决方法:即其他子视图不加在设置了alpha属性的视图层上,只是frame设置使其类似加在其上效果。
首先了解设置背景色透明样式的方法有两种
方法1、直接设置视图的背景颜色
[xxView setBackgroundColor:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1.0]];
方法2、设置视图的layer层背景色
[xxView.layer setBackgroundColor:[UIColor blackColor].CGColor];
[xxView setAlpha:0.8];
其次,不是非常好的解决方法:即其他子视图不加在设置了alpha属性的视图层上,只是frame设置使其类似加在其上效果。
相关文章推荐
- 设置父视图的alpha不影响子视图的
- textView 父视图alpha设置不影响子视图
- 如何在设置父视图的alpha的时候使子视图不受影响
- 视图的alpha属性可能会影响子视图的透明度
- UITextField常用属性归纳:文本框样式、文字样式、键盘样式、左右视图样式、清除按钮设置等,iosuitextfield
- iOS 设置父视图的透明度而不影响子视图的透明度
- iOS 如何设置子视图alpha不同于父视图
- QTreeWidget中对于其中item的可编辑属性的设置
- iOS设置子视图透明度不受父视图影响
- iOS开发UITextField常用属性归纳:文本框样式、文字样式、键盘样式、左右视图样式、清除按钮设置等
- iOS开发高级技巧-运行时属性runtime attribute设置视图圆角
- storyboard内设置视图属性(圆角和边框)
- jsp中影响编码的属性及其设置(嘿嘿,别人的好文章!)
- iOS设置父视图透明度而不影响子视图
- 设置android:clearTaskOnLaunch="true"属性对Activity行为的影响
- 有getter setter的属性在Inspector视图中设置值
- jsp中影响编码的属性及其设置小结(contentType,pageEncoding,charset,setCharacterEncoding
- jsp中影响编码的属性及其设置小结(contentType,pageEncoding,charset,setCharacterEncoding)
- alpha属性设置
- jsp中影响编码的属性及其设置小结