MAFUIView uses the MAFStyling protocol to extend the native UIView class with MAF styling capability.You can use this wrapper object to style the border and background of any UIView subclass. To inherit basic MAF skinning capability, inherit your own control views from this class.
MAFUIView* mafUIView = [[MAFUIView alloc]init]; [mafUIView sizeToFit]; [self setView:mafUIView]; //release mafUIView instance if not ARC based project. [mafUIView release];This creates an empty UIView that has a solid background color and a border brush. To change the style of this MAFUIView instance, define a simple style:
<Style Key="mafUIViewSampleStyle" TargetType="Window" platform="ios"> <Setter Property="Background" Value="#FFFFFF"/> <Border BorderBrush="#007AB6" BorderThickness="4"/> </Style>This XML definition applies a white background color and a blue 4-point border around the frame of the UIView.
[mafUIView setMafStyleName:@"mafUIViewSampleStyle"];
Set mafUIViewSampleStyle as a style name to any MAFUIView subclass to set its border brush and background. The background property can also apply a freestyle gradient.
Background | Color of the UIView's background; can also be a freestyle gradient. Colors are defined as RGBA (red, green, blue, alpha). |
Border | The border attributes of the UIView include:
|