Aggiungere il bordo ad una UIView
Per aggiungere il bordo ad un’UIView (o qualsiasi elemento subclassato da questo), si possono usare poche righe di codice. Innanzitutto va importato QuartzCore:
|
1 |
#import < QuartzCore/QuartzCore.h > |
e poi:
|
1 2 3 |
UIView *randomView = [[UIView alloc] init]; randomView.layer.borderColor = [[UIColor colorWithRed:0.8f green:0.8f blue:0.8f alpha:1.0f] CGColor]; randomView.layer.borderWidth = 1.0f; |
enjoy!