【发布时间】:2011-08-22 10:51:36
【问题描述】:
我正在设计一个包含标题标题栏的应用程序,我正在使用以下 xml 来创建标题栏。但我无法显示全宽,如果我使用 fill_parent 它的行为真的很奇怪。任何想法或任何建议如何创建标题标题栏,增加减少高度。非常感谢。
window_title.xml lay out below.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:padding="0px"
android:layout_width="fill_parent"
android:layout_height="60px"
android:background="#323331">
<ImageView
android:id="@+id/header"
android:src="@drawable/header"
android:layout_width="fill_parent"
android:layout_height="60px"/>
</LinearLayout>
.java file
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title);
【问题讨论】:
标签: android