macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

UISlider

INDEX>UIKit>

スライダークラス
継承 UIControl : UIView : UIResponder : NSObject
準拠 NSCoding
NSCoding (UIView)
UIAppearance (UIView)
UIAppearanceContainer (UIView)
NSObject (NSObject)
フレームワーク /System/Library/Frameworks/UIKit.framework
使用可能 iOS 2.0 以降
定義 UISlider.h

概要

UISliderオブジェクトは連続した値の範囲からの単一の値を選択するのに使うビジュアルコントロールです。
スライダーは垂直または水平のバーとして表示できます。
インジケーター、サム、スライダーの現在の値セッティングを変更する事ユーザーによって動かすことができます。

例文

//スライダー
	UISlider *aSlider = [[UISlider alloc] initWithFrame:CGRectMake(0,120,320,100)];
	[aSlider addTarget:self action:@selector(sliderAction:) 
					forControlEvents:UIControlEventValueChanged];
	
	aSlider.continuous = YES;

メソッドとプロパティ

スライダー値へのアクセス

value  property
–setValue:animated

スライダーの制限値へのアクセス

minimumValue  property
maximumValue  property

スライダーの挙動を集成します

continuous  property