当前位置: 代码迷 >> Iphone >> iphone跟ipad设置束的运用
  详细解决方案

iphone跟ipad设置束的运用

热度:25   发布时间:2016-04-25 06:35:03.0
iphone和ipad设置束的运用!
首先先创建一个Settings.bundle文件,在Root.plist文件编辑信息,
首先Application Preferences一共有
1.PSTextFieldSpecifier
2.PSTitleValueSpecifier
3.PSToggleSwitchSpecifier
4。PSSliderSpecifier
5.PSMultiValueSpecifier
6.PSGroupSpecifier
7.PSChildPaneSpecifier
7个条目,分别代表不同的视图!

键(key)                            值类型(type)                     值(value)
1. PSTextFieldSpecifier
IsSecure                              Boolean               YES/NO
KeyboardType                     String                 ( Value: Value must contain one of the following strings. Alphabet, NumbersAndPunctuation, NumberPad, URL and EmailAddress.)
AutocapitalizationType       String                 (Value: Value must contain one of the following strings. None, Sentences, Words, AllCharacters. Default value is None.)

AutoCorrectionType           String                   (Value: Value must contain one of the following strings. Default, No, Yes. Default value is Default.)
下同:
2.PSTitleValueSpecifier

Key: Type (required)
Type: String
Value: PSTitleValueSpecifier

Key: Title (required)
Type: String
Value: Your string value.

Key: Key (required)
Type: String
Value: Your string value.

Key: DefaultValue (required)
Type: String
Value: Your string value.

Key: Values
Type: Array
Value: Key-Value entry

Key: Titles
Type: Array
Value: Key-Value entry



3.PSToggleSwitchSpecifier

Key: Type (required)
Type: String
Value: PSToogleSwitchSpecifier

Key: Title (required)
Type: String
Value: Your string value.

Key: Key (required)
Type: String
Value: Your string value.

Key: DefaultValue (required)
Type: String
Value: Your string value.

Key: TrueValue
Type: Boolean
Value: YES

Key: FalseValue
Type: Boolean
Value: NO

4.PSSliderSpecifier

Key: Type (required)
Type: String
Value: PSSliderSpecifier

Key: Title (required)
Type: String
Value: Your string value.

Key: Key (required)
Type: String
Value: Your string value.

Key: DefaultValue (required)
Type: String
Value: Your string value.

Key: MinimumValue (required)
Type: Number
Value: Minimum number value here

Key: MaximumValue (required)
Type: Number
Value: Maximum number value here

Key: MinimumValueImage
Type: String
Value: Image (21*21)

Key: MaximumValueImage
Type: String
Value: Image (21*21)

5.PSMultiValueSpecifier

Key: Type (required)
Type: String
Value: PSMultiValueSpecifier

Key: Title (required)
Type: String
Value: Your string value.

Key: Key (required)
Type: String
Value: Your string value.

Key: DefaultValue (required)
Type: String
Value: Your string value.

Key: Values
Type: Array
Value: Key-Value entry.

Key: Titles
Type: Array
Value: Key-Value entry.

6.PSGroupSpecifier

Key: Type (required)
Type: String
Value: PSGroupSpecifier

Key: Title (required)
Type: String
Value: Your string value.

7.PSChildPaneSpecifier

Key: Type (Required)
Type: String
Value: PSChildPaneSpecifier

Key: Title (required)
Type: String
Value: Your string value.

Key: File
Type: String
Value: The name of plist file, without the extension.

最后在程序中根据key得到用户设置的value
NSstring default =  [[NSUserDefaults standardUserDefaults] stringForKey:@”key”];
  相关解决方案