Create Rounded UIViews With Shadow
So here is small tip how to create rounded UIViews with shadow.
- Create simple Window-based Application with name TestApp.
- Click on File->New file and select Objective-C class with UIView subclass and name it MyView
- Now open MyView.m and edit initWithFrame part with this code
1 2 3 4 5 6 7 8 9 10 11 12 13 14
- Now add
#import <QuartzCore/QuartzCore.h>line to your MyView.m
- Open TestAppAppDelegate.m and add
- Now in application didFinishLaunching add folowing code
- Save and run and you should have rounded black view on the main window, now add other subviews or modify by your will
Here is file ready for download.