I have this custom layout as in this picture :
The four rectangles are UIViews with border lines over a CALayer. In the middle of this rectangles are another UIView as a circle. I would like to draw the border line of the circle where the rectangles are open. The difficulty is that the rectangles are autoresizing and the UIView in the middle. How can I make that ?
Related
Initially I have 2 backgrounds images (I use here 2 rectangles for simplicity, a green one and a grey one) the rectangles height is dynamically adjustable and I need to draw the black wave divider (also a custom image with gradient) between them as you can see in the image. I've tried to simply crop the backgrounds with the divider and merge them, but because the height (first rectangle will have a different height than the second one) is adjustable it will mess up the wave divider. It is not enough to draw the divider, also the rectangles should be cropped to match the divider form. Everything should be done programmatically in Swift and a pdf document will be generated in the end. I can only think to Bezier Curve (CGMutablePath, UIBezierPath), but I don't know exactly how to achieve it. Thanks a lot!
Shape I need to obtain
Grey Rectangle
Green rectangle
I have a view UIView that by default has a UIImageView (the blue square in the included image) that is centered in this main view (the gray square in the included image). The main view has an added CALayer that serves as a border (window or mask — the yellow rectangle in included image) through which the image can be seen. The user uses gesture recognizers to pan (translate), pinch (scale), and rotate the image view's transform, but I'd like to give them the option of transforming the image so it completely fills the yellow border (all four corners), much the same way the iOS crop tool does (see attached gif). I've tried to figure out how I can calculate the correct scale factor, but now I'm wondering — is there some simple formula or function that can help me solve this problem?
I have a problem with rotating UIImageView. As you look at the attached screenshot you will find that image is rotated but the frame of UIImageView has some unwanted empty area. The blue line around image is the frame of UIImageView.
How can I remove that empty area? And assign that much of frame which is require by image.
I am trying to mask a complete UIView is this possible? The view I am trying to mask has a blur effect layered on top of it. I am to successfully mask the image under the UIView but not the entire View itself. Basically I need to be able to mask a UIView.
I have a series of images that are centered on top of a transparent background. I would like to add a white border to all of them and I could draw it if I had the path of the border of the opaque part of the image. Is it possible to extract this?