相关疑难解决方法(0)

Android:自定义标题栏

我有一个自定义标题栏

 requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
 setContentView(R.layout.activities);
 getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);
Run Code Online (Sandbox Code Playgroud)

哪个工作基本上很好.问题是,在调用上面的代码之前,会显示默认标题栏.我根本不想要一个标题栏,换句话说,在我出现之前不会出现任何标题.

将此添加到清单:

<application android:theme="@android:style/Theme.NoTitleBar">
Run Code Online (Sandbox Code Playgroud)

导致力量关闭.我的清单看起来像这样

<application android:icon="@drawable/icon" android:label="@string/app_name"
    android:theme="@style/My_Theme">
Run Code Online (Sandbox Code Playgroud)

我需要my_Theme,因为它设置了背景颜色,在我的客户主题中设置背景颜色会导致我的彩色背景周围的灰色区域.因此,即使没有力量关闭,我也不确定没有标题会有所帮助.

任何的想法?

谢谢.

layout android titlebar

11
推荐指数
1
解决办法
4万
查看次数

标签 统计

android ×1

layout ×1

titlebar ×1