简体   繁体   中英

iOS6/iOS 7 UIView transparency

So I have a game application, it has answer screen. Answer screen has 0.9 alpha and answer button has 1.0f. You can see on screenshot.

iOS 6

The same on iOS 7

IOS 7

Button alpha is still 1.0, but it looks transparent. If I do background view alpha 1.0 it works on iOS 7, but I extremely need user to see background under the view.

Please help.

for the view that is semi-transparent set the alpha this way:

UIView *view.backgroundColor=[[UIColor whiteColor] colorWithAlphaComponent:.6];

not:

UIView *view.backgroundColor=[UIColor whiteColor];    
view.alpha=.6;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM