How to use Ios--uislider

Source: Internet
Author: User

How to use Ios--uislider

Common methods of UISlider

UISlider *oneslider = [[UISlider alloc] init];

Most commonly used

Oneslider.frame = CGRectMake (10, 20, 300, 30); Setting location and size Note: The height of the uislider can be set casually, because it will not change.

Oneslider.value = 30; Initial value

Oneslider.minimumvalue = 0; Minimum value

Oneslider.maximumvalue = 100; Maximum Value

Oneslider.backgroundcolor = [Uicolor Bluecolor]; Set Background color

Oneslider.alpha = 0.9; Set transparency

Oneslider.tag = 1001; Set tags, commonly used in delegates

[Oneslider addtarget:self Action: @selector (Oneslidervaluechange:) forcontrolevents:uicontroleventvaluechanged];// To set the response method for response Oneslider

Custom UISlider

Oneslider.backgroundcolor = [Uicolor Clearcolor]; Clear the background color first

[Oneslider setminimumtrackimage:[uiimage imagenamed:@ "Min.png"] forstate:uicontrolstatenormal];

[Oneslider setmaximumtrackimage:[uiimage imagenamed:@ "Max.png"]forstate:uicontrolstatenormal];

Add to view and free up memory

[Self.view Addsubview:oneslider];

[Oneslider release], oneslider = nil;

How to use Ios--uislider

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.