- Trending Categories
- Data Structure
- Operating System
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to Set opacity for View in iOS?
View’s Alpha value is a floating-point number in the range 0.0 to 1.0, where 0.0 represents totally transparent and 1.0 represents totally opaque. Changing the value of this property updates the alpha value of the current view only.
You can simply adjust alpha value based on the opacity you want.
Write the following line in you viewDidLoad method
view.backgroundColor = UIColor(white: 1, alpha: 0.5)
Run the application, the view’s opacity you can see is 50%
- How to Set opacity for View in Android?
- How to set background color of a View in iOS App?
- How to set background for Navigation Bar in iOS?
- How to set Row Header View for JScrollPane in Java?
- How to navigate from one view controller to another in iOS?
- Set Border for an ImageView in iOS?
- Disable Scroll View Programmatically in iOS?
- How to get the dimensions of a view in iOS App?
- Set the opacity for the background color with CSS
- How to set the opacity of Triangle using FabricJS?
- How to set the opacity of Textbox using FabricJS?
- How to set the opacity of Image using FabricJS?
- How can I set an icon for my iOS application?
- How to set the opacity of an Ellipse using FabricJS?