我正在尝试使用开发分支HoloEverywhere 库添加到我的应用程序中。我知道这仍处于开发阶段,但演示似乎工作正常,所以我尝试一下。
I put android:theme="@style/Holo.Theme.Sherlock.Light"在我的清单中的活动中。 Activity的结构是它使用Fragment,一个是列表,另一个只是Fragment。 ActionBar 看起来 Holo 就很好。
我转动了我的Sherlock Fragment活动 into S活动 and Fragment into SF片段。正如我检查附带的演示应用程序一样。我在 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。进度对话框也显示操作系统的主题。
我相信这是我错误地实现了该库。问题是怎样做才是正确的?
编辑:解决了,我需要使用com.WazaBe.HoloEverywhere.app.AlertDialog代替android.app.AlertDialog。愚蠢的我。
解决了,我需要使用com.WazaBe.HoloEverywhere.app.AlertDialog代替android.app.AlertDialog。愚蠢的我。
按建议添加答案。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)