Use Uibezierpath. A sample code is given below.
1UIView *view2 = [[UIView alloc] Initwithframe:cgrectmake ( -,Ten, the, the)];2View2.backgroundcolor =[Uicolor Redcolor];3 [Self.view addsubview:view2];4 5Uibezierpath Maskpath = [Uibezierpath bezierPathWithRoundedRect:view2.bounds byroundingcorners: Uirectcornerbottomleft | Uirectcornerbottomright Cornerradii:cgsizemake (Ten,Ten)];6Cashapelayer Masklayer =[[Cashapelayer alloc] init];7Masklayer.frame =view2.bounds;8Masklayer.path =Maskpath.cgpath;9View2.layer.mask =Masklayer;Ten One A //specifies the corners that need to be rounded corners. The parameter is of type Uirectcorner, and the optional values are: - -*Uirectcornertopleft the*Uirectcornertopright -*Uirectcornerbottomleft -*Uirectcornerbottomright -* Uirectcornerallcorners
Some corners of the specified UIView for iOS development are rounded corners