【发布时间】:2010-08-17 10:32:29
【问题描述】:
朋友的, 我在设置布局高度时遇到问题,我有三个单独的 xml 布局的布局,
1.header.xml 它有一个文本视图 2.main.xml有frmelayout和listview
3.content.xml
it have field to bind in framelayout listview.
我需要知道如何尽可能增加标题的高度,
这里是我获取解决方案的代码
实际上我在这里遇到了问题,我在标题中有菜单库,当将此图库视图放在标题下方时,我将其隐藏在图库的一半下方,因为标题的高度无法更改感觉,
这里是 header.xml 的代码
<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent" android:background="@drawable/gradient_black"
android:layout_gravity="center_horizontal" android:layout_width="fill_parent"
android:orientation="horizontal">
<ImageView android:src="@drawable/image_button1" android:id="@+id/back"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true"/>
<TextView android:id="@+id/header_text1" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/back"
android:textSize="20sp" android:textStyle="bold" android:textColor="@color/white"
android:layout_marginLeft="60dip" android:layout_centerVertical="true"
android:layout_centerHorizontal="true" android:ellipsize="end"
android:singleLine="true" />
<ImageView android:src="@drawable/image_button" android:id="@+id/share"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_toRightOf="@+id/header_text1" android:paddingTop="10dip"
android:paddingLeft="50dip" />
<Gallery android:id="@+id/gv" android:layout_width="fill_parent" android:paddingTop="0dip"
android:layout_height="fill_parent" android:spacing="15dip"
android:layout_below="@+id/back"
android:gravity="bottom" android:paddingBottom="0dip"/>
</RelativeLayout>
这里是 main.xml 的代码,它有一个 FrameLayout 有列表视图,有标签主机和顶部的线性布局
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="200dip" android:id="@+id/main_lay">
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:id="@android:id/tabcontent"
android:layout_width="fill_parent" android:layout_height="100dip"
android:layout_marginTop="100dip">
<ListView android:id="@+id/content_listview"
android:layout_width="fill_parent" android:layout_height="340dip" />
</FrameLayout>
.
.
.
</LinearLayout>
----
</TabHost>
==================== 列表内容字段的代码
它有 linerlayout 与三个字段设置在列表中...
===== 我的活动代码
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.main); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.header);
。 ;.---- 帮助我在标题中获得清晰的画廊视图,而不会隐藏在底部,或者只是如何增加标题布局的高度。
【问题讨论】:
-
我们需要 XML 代码,否则:layout_height 是我的答案
标签: android