Most visited

Recently visited

Added in API level 1

PreferenceCategory

public class PreferenceCategory
extends PreferenceGroup

java.lang.Object
    android.preference.Preference
      android.preference.PreferenceGroup
        android.preference.PreferenceCategory


用于分组 Preference对象并在组上方提供禁用的标题。

Developer Guides

有关使用首选项构建设置UI的信息,请阅读 Settings指南。

摘要(Summary)

Inherited XML attributes

From class android.preference.PreferenceGroup
From class android.preference.Preference

Inherited constants

From class android.preference.Preference

Public constructors

PreferenceCategory(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
PreferenceCategory(Context context, AttributeSet attrs, int defStyleAttr)
PreferenceCategory(Context context, AttributeSet attrs)
PreferenceCategory(Context context)

公共方法(Public methods)

boolean isEnabled()

检查此首选项是否应在列表中启用。

boolean shouldDisableDependents()

检查当前是否应该禁用此首选项的依赖项。

Protected methods

boolean onPrepareAddPreference(Preference preference)

准备将 Preference添加到组中。

继承方法(Inherited methods)

From class android.preference.PreferenceGroup
From class android.preference.Preference
From class java.lang.Object
From interface java.lang.Comparable

Public constructors

PreferenceCategory

Added in API level 21
PreferenceCategory (Context context, 
                AttributeSet attrs, 
                int defStyleAttr, 
                int defStyleRes)

参数(Parameters)
context Context
attrs AttributeSet
defStyleAttr int
defStyleRes int

PreferenceCategory

Added in API level 1
PreferenceCategory (Context context, 
                AttributeSet attrs, 
                int defStyleAttr)

参数(Parameters)
context Context
attrs AttributeSet
defStyleAttr int

PreferenceCategory

Added in API level 1
PreferenceCategory (Context context, 
                AttributeSet attrs)

参数(Parameters)
context Context
attrs AttributeSet

PreferenceCategory

Added in API level 1
PreferenceCategory (Context context)

参数(Parameters)
context Context

公共方法(Public methods)

isEnabled

Added in API level 1
boolean isEnabled ()

检查此首选项是否应在列表中启用。

返回(Returns)
boolean True if this Preference is enabled, false otherwise.

shouldDisableDependents

Added in API level 1
boolean shouldDisableDependents ()

检查当前是否应该禁用此首选项的依赖项。

返回(Returns)
boolean True if the dependents should be disabled, otherwise false.

Protected methods

onPrepareAddPreference

Added in API level 1
boolean onPrepareAddPreference (Preference preference)

准备将 Preference添加到组中。

参数(Parameters)
preference Preference: The preference to add.
返回(Returns)
boolean Whether to allow adding the preference (true), or not (false).

Hooray!