View with low alpha - Subview with high alpha

前端 未结 1 1518
予麋鹿
予麋鹿 2020-12-28 16:23

I have a UIView with an alpha of .5 I have added a subview with an alpha of 1.

The subview seems to inherit the alpha value of the parent. Is there a w

相关标签:
1条回答
  • 2020-12-28 17:23

    Set the inputPrompt's background color's alpha not its alpha directly.

    [inputPrompt setBackgroundColor:[[UIColor darkGrayColor] colorWithAlphaComponent:0.5]];
    //[inputPrompt setAlpha: .5]; 
    
    0 讨论(0)
提交回复
热议问题