T
T
tupoi2017-09-02 16:43:32
iOS
tupoi, 2017-09-02 16:43:32

How to make rounded corners on View only at the top?

Good day, there was a need to make slightly rounded corners of the UIView on top. I know how to round the corners of the entire View, but it just doesn’t work from above, maybe someone knows how this can be done? Here is an example of how it should be.
f60311f0d3cf4cb08b59d779e29e7307.jpg
Thanks in advance)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
Johnny Smith, 2017-09-02
@tupoi

if you don’t find the answer, then “overlap” with a sublayer only with pointed corners on top, with a height equal to the radii of the circles at the corners, of the same color (sublayer)
https://tldrify.com/nzo
PS anywhere, just make sure to mark in the code that this is a crutch, otherwise if someone else reads it, it will go nuts
... PPS you can still pin it and insert an ASCII graphic next to it, comment it out, briefly, like this one, lol:

Костль его спотыкательство:



   _        _
  ( `-.__.-' )
   `-.    .-'
      \  /
       ||
       ||
      //\\
     //  \\
    ||    ||
    ||____||
    ||====||
     \\  //
      \\//
       ||
       ||
       ||
       ||
       ||
       ||
       ||
       ||
       []

или трость смотрится солиднее, в общем советую поставить чтото такое что привлекает внимание както

   .-""-.
  / .--. \
  | |  | |
  \_|  | |
       | |
       | |
       | |
       | |
       | |
       | |
       | |
       | |
       | |
       | |
       |_|
       [_]

S
SevenDays, 2017-09-02
@SevenDays

https://stackoverflow.com/a/35621736/760518

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question