Answer the question
In order to leave comments, you need to log in
How to color a UIButton in a specific ratio?
The iOS platform, xcode development environment is considered.
There is a button (let's say green). How to programmatically paint it in a different color in some ratio from left to right or top to bottom? An example in the picture.
Answer the question
In order to leave comments, you need to log in
There are various options, starting with a vector / raster image and ending with drawInRect
Here is an excellent overview article where we went through everything (except for the CALayer mentioned above)
https://robots.thoughtbot.com/designing-for-ios-ta...
Here's more from Ray only with CoreGraphics www.raywenderlich.com/33330/core-graphics-tutorial...
How to draw two squares, I think you google it yourself
PS Personally, I prefer the option with DRawRect
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question