【发布时间】:2015-04-19 09:05:37
【问题描述】:
我希望让我的一项活动看起来像一个对话框,并为其使用了 Theme.AppCompat.Dialog 主题,但它使它的操作栏看起来很糟糕(见下文)。
现在背景被剪切到标题字符串的长度,我找不到任何主题属性来修复它。(
可以做些什么来避免它?
styles.xml相关部分:
<style name="DeviceListTheme" parent="Theme.AppCompat.Dialog">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
我使用以下代码开始活动:
Intent intent = new Intent(this, DeviceListActivity.class);
startActivityForResult(intent, REQUEST_CONNECT_DEVICE);
【问题讨论】:
-
粘贴 style.xml 中的代码和显示 actionbar 相关的 activity 中的代码
-
标题是
Select device吗?还是常规的 TextView? -
@JuanjoVega - “选择设备”是 manifest.xml 中设置的标题。我没有尝试以任何方式分配自定义操作栏布局。
-
如果您觉得我的回答有用,您能接受吗? ;)
标签: android dialog android-actionbar styles themes