gpt4 book ai didi

android - 使用 listpreference 并获取 key 有效但没有确定按钮

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:25:33 25 4
gpt4 key购买 nike

我在我的 Android 应用程序中使用 listpreference 并获取我的关键值,一切都很好并且运行良好(现在你们帮助了我)但是 - 当我的 listpreference 菜单弹出时,它们只包含一个取消按钮。

假设用户在红色、蓝色和绿色之间进行选择。当列表首选项对话框第一次弹出时,对话框只显示一个取消按钮。因此,一旦用户选择了他们的选择,对话框就会消失。我希望这样,当用户选择他们的设置时,他们会看到单选按钮突出显示,然后他们继续并单击确定按钮……但我没有确定按钮,也不知道为什么。任何帮助都会很棒......al

最佳答案

您可以克隆并重新实现 ListPreference 以按照您想要的方式工作,从而创建您自己的自定义 Preference 类。

但是,ListPreference 设置为仅使用否定(“取消”)按钮。正如源代码所说:

    /*
* The typical interaction for list-based dialogs is to have
* click-on-an-item dismiss the dialog instead of the user having to
* press 'Ok'.
*/

关于android - 使用 listpreference 并获取 key 有效但没有确定按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2520021/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com