PreferenceScreen 和 DialogPreference 中的 EditText 包含 PreferenceScreen/CheckBoxPreference
我有一个应用程序,我希望在一个屏幕上有多个 EditText,然后在每个按钮的右侧有一个按钮,用于打开与该 EditText 相关的设置对话框
问题是,我正在尝试在 PreferenceActivity 中执行此操作。 我知道我可以使用首选项作为按钮来打开普通活动来显示线性布局(或相对布局),但这确实不能满足我的需要。
我可以在preferenceActivity中使用EditTextPrefence,但这确实不是首选(如果必须的话它会起作用),我可以只使用带有复选框的DialogPreference,但我真的很喜欢CheckBoxPreference的摘要功能,所以我会而是有一个打开的对话框首选项,然后显示 CheckboxPreferences 的首选项屏幕。
因此,我只需要在首选项屏幕中使用 EditText 并在 DialogPreference 中使用 CheckBoxPreference
这似乎不可能,但如果是这样,我们将不胜感激。
谢谢。
I have an application, where I want there to be several EditTexts on one screen, and then to the right of each, a button that will open a dialog for settings related to that EditText
Issue is, I am trying to do this within a PreferenceActivity.
I know I could just use a preference as a button to open a normal Activity to display the linearlayout (or relativelayout), but that really doesn't satisfy what I need.
I can use an EditTextPrefence in the preferenceActivity, but that's really not preferred (it will work if it has to), and I could just use a DialogPreference with checkboxes in it, but I really like the summary capability of a CheckBoxPreference, so I would rather have a dialogpreference that opens and then shows a PreferenceScreen of CheckboxPreferences.
So, I just need an EditText within a preferenceScreen and a CheckBoxPreference within a DialogPreference
It doesn't seem like this is possible, but if so, any help would be greatly appreciated.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于这些似乎不是首选项,因此请使用
EditText
和CheckBox
小部件创建常规活动。然后,您几乎可以随心所欲地设计它。如果,OTOH,这些确实是首选项,那么请使用标准 Android 首选项 UI,它与您所描述的不同。标准 Android 首选项 UI 背后的要点是它是标准,带有少量自定义(例如,创建某种颜色选择器 DialogPreference)。你的改变听起来并不小。
Since it would appear that these are not preferences, please create a regular activity, using
EditText
andCheckBox
widgets. Then, you can design it pretty much however you want.If, OTOH, these are indeed preferences, then please use the standard Android preference UI, which does not resemble what you are describing. The point behind the standard Android preference UI is for it to be standard, with minor customizations (e.g., creating some sort of color-picker DialogPreference). Your changes do not sound minor.