NetEase News DemoCombining the navigation controller and Tabbar controller with the first two days of learning and TableView can easily build a UI interfaceTake NetEase news as an example1 First Customize a Tabbar controller (this controller inherits from the Tabbar controller) as the root controller of the appCreate the corresponding five item controller for the custom Tabbar, and set the corresponding base setting for the Tabbar2 initializing a navi
*) ScrollView Withview: (UIView *) view{}//Zoom end-(void) scrollviewdidendzooming: (UISCR Ollview *) ScrollView Withview: (UIView *) View Atscale: (float) scale{}//view has been enlarged or shrunk-(void) Scrollviewdidzoom: (UISCROLLV Iew *) Scrollview{nslog (@ "Scrollviewdidscrolltotop");}*/ //do you want to support sliding to the top-(BOOL) Scrollviewshouldscrolltotop: (Uiscrollview *) scrollview{returnYES;} //call this method when sliding to the top- (void) Scrollviewdidscrolltotop: (Uiscrol
colorButton.backgroundcolor = [Uicolor Clearcolor];[Button Setbackgroundcolor:[uicolor Clearcolor];4. State statusForstate: The function of this parameter is to define how the text or picture of the button will appear in the state.Enum0,// general status show 10,//Highlight status show 1 112,//Check status 0x00ff0000,// When the application flag is 0xff000000 //reserved for the internal frame, it can be no matter what he};5. UIButton Common PropertiesSets the caption contents of the cor
The main purpose of Uilabel is to display a paragraph of text, thus providing many APIs related to explicit text.UILabel *onelabel = [[UILabel alloc] init];1, Frame onelabel.frame = CGRectMake (0, 0, 320, 200); Setting the location and size of the Onelabel1. Text Onelabel.text = @ "user name";2, TextColor (text content color) Onelabel.textcolor = [Uicolor redcolor];3, textalignment (text alignment---horizontal direction)Onelabel.textalignment = Nstextalignmentleft;4, Onelabel.backgroundcolor
) targetaction: (SEL) Actionforcontrolevents: (uiconstrolevents) controlevents3) Delete event-(void) Removetarget: (ID) targetaction: (SEL) Action forcontrolevents: (uiconstrolevents) controlevents 5. Common events: UiconstroleventsUicontroleventtouchdown Button PressPress the UIControlEventTouchUpInside button in the pop-upPress the Uicontroleventtouchupoutside button to bounce off the button6.UIView Tags: settagExercise: Analog SMS Verification Code send button==========================UIImage
the Superview is constant uiviewautoresizingflexiblerightmarginThe right distance from the Superview is automatically adjusted to ensure that the distance to the left of the Superview is constant. UiviewautoresizingflexibletopmarginAutomatically adjusts the distance from the top of the Superview to ensure that the distance from the bottom of the Superview is constant. UiviewautoresizingflexiblebottommarginAutomatically adjusts the distance from the bottom of the superview to ensure that the dis
The address is as follows: Http://yunpan.cn/cV2SxIsBvu5Ak (extract code: B2CE) User name: $ (function () { $ (' #acc1 '). Validate ( {rules:{ User: { Required:true, Minlength:2 } },messages:{ User: { Required: ' User name cannot be empty ', MinLength: ' User name cannot be less than 2 bits ' } } } )//Verification})JQ
) Iboutlet Uitextfield *Qqnum; -@property (Weak, nonatomic) Iboutlet Uitextfield *Qqpassword; the --(ibaction) login; - - @end + - @implementationViewcontroller + A- (void) Viewdidload { at [Super Viewdidload]; - //additional setup after loading the view, typically from a nib. - } - -- (void) didreceivememorywarning { - [Super didreceivememorywarning]; in //Dispose of any resources the can be recreated. - } to + /** Login*/ --(ibaction) Login { the //print Qqnumber and QQ passw
agent(1) Find out who is Who's agent first (delegate)(2) Define proxy protocol, naming specification for protocol Name: control class name + Delegate(3) Defining proxy methodsProxy methods are generally defined as @optionalProxy method names begin with the control nameThe proxy method has at least 1 parameters, passing the control itself out(4) Set proxy (Delegate) object (for example myview.delegate = xxxx;)Proxy Object Compliance ProtocolThe implementation method of the Proxy object Implement
) Location, etc. universal property settings Headbtn.frame=cgrectmake (100, 100, 100, 100); 47 48//(2) Set the properties of the button in the normal state [headbtn setbackgroundimage:[uiimage imagenamed:@ "I"] Forstate:uicontrolstatenorma L]; [headbtn settitle:@] dot me! [Forstate:uicontrolstatenormal]; Wuyi [headbtn Settitlecolor:[uicolor Redcolor] forstate:uicontrolstatenormal]; 52 53//(3) Set the properties of the button in the Highlight state [headbtn setbackgroundimage:[uiimage imagenamed:
= [NSString stringWithFormat:@"%@\n%@", prefix, name]; //create a string with attributes (such as text attributes such as color attributes, font properties, and so on)Nsmutableattributedstring *attrstr =[[Nsmutableattributedstring alloc] initwithstring:str]; //Add Property[Attrstr addattribute:nsfontattributename Value:[uifont boldsystemfontofsize: -] Range:[str Rangeofstring:prefix]]; [Attrstr addattribute:nsfontattributename value:[uifont systemfontofsize: A] Range:[str Rangeofstring:name]];
of an object3. Need to avoid magic numbers in program development (magic number)Use enum types to avoid magic numbers in your program(1) An enumeration type is essentially an integer that is used to replace the magic number(2) After the first integer is specified in the enumeration type, the following number is incremented4. Frame Bounds Center1> frame can modify the object's position and size2> bounds can modify the size of an object3> Center can modify the position of an object5. End-to-end
Ios ui basics 08 and iosui08
Custom height cell
// Create a custom cell and add a child Control Using initWithStyle (note: The child control must be added to contentView)-(instancetype) initWithStyle :( UITableViewCellStyle) style reuseIdentifier :( NSString *) reuseIdentifier NS_AVAILABLE_IOS (3_0); // Method for adding a sub-space by creating a custom view in the traditional mode //-(instancetype) init
Ios ui basics 05 and iosui05
UIScrollView
UIScrollView procedure
1. Create UIScrollView
2. Add the content to be displayed to UIScrollView.
3. Set the rolling range (contentSize) of UIScrollView)
Note: If you want UIScrollView to be rolled, you must set a range that can be rolled.
Several situations where scrollView cannot be rolled
1. The contentSize is not
IOS UI basics 03, iosui03
Plist File
Root: What type of data is storedIf the root is an array, all items in the plist array will be read from the file in the future. Each item in the plist array represents the type of an element item in the array and represents the type of each element in the array.
The name of the custom plist file cannot contain the word info, because the system configuration i
uiview, responsible for monitoring the internal events of UIView, responsible for handling uiview and user interaction;
Uiviewcontroller has a UIView attribute inside it, which is the UIView object that it manages:
@property (nonatomic, retain) UIView *view;2, Ibaction Iboutlet
Ib:interface Builder interface setup;
Ibaction: Requires action, such as a button click;
Iboutlet: The attribute needs to be obtained and modified;
You can establish a connection with story
the order, because some of the control location calculation needs to consider the previous control position, the object created by the successive dependencies of each other, reducing the coupling between the code).
9, Strong Weak
10, Tom Cat optimization
Note: When adding an animated frame sequence, be aware of freeing up memory!!! In this case, you need to release the self.tom.animationImages corresponding to the photo array.
------------
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.