gpt4 book ai didi

android - 使用 HoloEverywhere 的正确方法是什么

转载 作者:太空狗 更新时间:2023-10-29 16:21:52 27 4
gpt4 key购买 nike

我正在尝试在我的应用程序中使用 HoloEverywhere 库的 dev 分支。我知道这仍在开发中,但演示似乎运行良好,所以我试一试。

我将 android:theme="@style/Holo.Theme.Sherlock.Light" 放在 list 的 Activity 中。 Activity 的结构是它使用 fragment ,一个是列表,另一个只是 fragment 。 ActionBar 看起来很不错。

我将我的 SherlockFragmentActivity 变成了 SActivity,将 Fragment 变成了 SFragment。就像我 checkin 随附的演示应用程序一样。我在我的 SFragment 中使用这段代码打开对话框。

    AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle("Work in Progress")
.setView(inflater.inflate(R.layout.extra_input))
.setIcon(R.drawable.icon);
builder.setPositiveButton("Positive", null);
builder.setNegativeButton("Negative", null);
builder.setNeutralButton("Neutral", null);
builder.show();

弹出的对话框看起来像操作系统的 AlertDialog,其中 extra_input 布局中的 EditText 显示为 Holo。 ProgressDialog 也与操作系统的主题一起显示。

我认为这是我错误地实现了库。问题是如何做对?

编辑:已解决,我需要使用 com.WazaBe.HoloEverywhere.app.AlertDialog 而不是 android.app.AlertDialog。傻我。

最佳答案

解决了,我需要使用 com.WazaBe.HoloEverywhere.app.AlertDialog 而不是 android.app.AlertDialog。傻我。

根据建议添加答案。

关于android - 使用 HoloEverywhere 的正确方法是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12481164/

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