Various small controls in the UI design

Source: Internet
Author: User

Xib supports graphical operations, provides almost all of the controls to choose from, and simply drags them to the appropriate location, but the control's background code still needs to be written manually, to some extent accelerating the development of the foreground.

Xib Rapid Development Program, handwriting code speed is relatively slow

Xib for static pages, code for dynamically complex pages

Xib not suitable for Svn/git code management, the code is more suitable for

Xib not suitable for post-maintenance, code for long-term maintenance

If the Xib file name is the same as the folder name where the class resides, you can use the Init method to automatically find the Xib resource file with the same name

Uiswitch switch

Setting the status of the switch when displayed

[Myswitch Seton:yes];

Set the color of the open state

Myswitch.ontintcolor=[uicolor Redcolor];

Set the color of the off state

Myswitch.tintcolor=[uicolor Redcolor];

The color of the button in the middle of the switch

Myswitch.thumbtintcolor=[uicolor Yellowcolor];

Uiactivityindicatorview Activity Indicator (Status display control that appears when loading something)

Default = Yes,yes means hidden

Activityindicator.hidden=no;

UISlider Slide Bar

Set the minimum value of the slider bar

myslider.minimumvalue=1;

Set the maximum value of the progress bar

myslider.maximumvalue=10;

Sets the background color of the progress bar button

Myslider.thumbtintcolor=[uicolor Redcolor];

The color of the left slide bar

Myslider.minimumtracktintcolor=[uicolor Bluecolor];

The color of the right slider bar

Myslider.maximumtracktintcolor=[uicolor Yellowcolor];

Uistepper Increase/Decrease button

Least-Reduced value

stepper.minimumvalue=0;

The maximum value added to

stepper.maximumvalue=1;

The value of each change, plus or minus 0.2

stepper.stepvalue=0.2;

Uiprogressview progress bar

Set the progress position to 0

progressview.progress=0;

progress bar color to complete progress

Progressview.tracktintcolor=[uicolor Redcolor];

Unfinished progress bar Color

Progressview.progresstintcolor=[uicolor Greencolor];

Uidatepicker Calendar

Display the date mode (also the hour mode, date plus hour mode)

Picker.datepickermodedate=uidatepickermodedate;

NSDate Date

Set the maximum date

NSDate nowdate=[nsdate Date];

NSDate Maxdate=[nowdate datebyaddingtimeinterval:3600*24*30];

Picker.maximumdate=maxdate;

Uialertview dialog box

Set the contents of the popup dialog box

Uialertview *alertview=[[uialertview alloc] initwithtitle:@ "Prompt" message:@ "Are you sure you want to delete it?" Delegate:nil cancelbuttontitle:@ "No" otherbuttontitles:@ "yes", nil];

Set the mode of the lift dialog box

Alertview.alertviewstyle=uialertviewstyleloginandpasswordinput;

The Settings dialog box is displayed and will not be displayed if not set.

[Alertview show];

Uiactionsheet List of actions selected from the bottom of the phone

Set the show Eject box, not set will not be rolled out

Uiactionsheet *sheet=[[uiactionsheet Alloc] initwithtitle:@ "action" delegate:self cancelbuttontitle:@ "Save to Phone" destructivebuttontitle:@ "Send to Friends" otherbuttontitles:@ "other Shares", nil]; Set the contents of the Eject box

Sheet.actionsheetstyle=uiactionsheetstyleautomatic; The mode of the rollout box

[Sheet ShowInView:self.view];

Nstimer Timer

Sets the timer to trigger an event every second, invokes a method in this class and repeats the call

_timer=[nstimer scheduledtimerwithtimeinterval:1 target:self selector: @selector (updatelabel:) Userinfo:nil repeats: YES];

Nstimer *timer;

Pause Timer (Start again after a long time)

[Timer setfiredate:[nsdate distantfuture];

Restart timer (starting at current time)

[Timer setfiredate:[nsdate Date]]; Or (from the last moment) [Timer setfiredate:[nsdate Distantpast]];

Destroy the timer.

if ([Timer isValid])

{

[Timer invalidate];

}

Various small controls in the UI design

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.