1. Reference quartzcore. Framework in the project
2. Reference The quartzcore. h library in the appdelegate. M file.
# Import<Quartzcore/quartzcore. h>
3. Add the following before the return YES statement of the application: didfinishlaunchingwitexceptions: method:Code
Uiapplication * APP =[Uiapplication sharedapplication]; [App setstatusbarstyle: uistatusbarstyleblackopaque];Self. Window. rootviewcontroller. View. layer. cornerradius =5; Self. Window. rootviewcontroller. View. layer. maskstobounds= Yes;
4. The overall code is as follows:
# Import " Appdelegate. h " # Import <Quartzcore/quartzcore. h> @ Implementation Corner_testappdelegate @ Synthesize Window = _ Window; @ Synthesize Viewcontroller = _ Viewcontroller; -(Bool) Application :( uiapplication *) Application didfinishlaunchingwitexceptions :( nsdictionary * ) Launchoptions { Self. Window. rootviewcontroller = Self. viewcontroller; [self. Window makekeyandvisible]; uiapplication * APP = [Uiapplication sharedapplication]; [App setstatusbarstyle: uistatusbarstyleblackopaque]; Self. Window. rootviewcontroller. View. layer. cornerradius = 5 ; Self. Window. rootviewcontroller. View. layer. maskstobounds = Yes; Return Yes ;}