我已将图像添加到我的xml文件。这是我正在使用的代码:Android布局 - 占用额外空间的图像
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/topbar_logo2x"
android:scaleType="fitStart" />
<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="fill_parent"
android:orientation="vertical" >
<View
android:layout_width="fill_parent"
android:layout_height="0.5dip"
android:background="#000" />
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="0dip"
android:layout_marginRight="0dip" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
</TabHost>
</LinearLayout>
我希望我的TabHost完全位于我的图像之上。当我在StackOverflow上签了一些答案,我得到了说明使用
android:scaleType="fitStart"
我想使用相同的ImageView都android:scaleType="fitStart"
和android:scaleType="fitEnd"
,这是不可能的答案Sndroid将使scaleType
只有一个声明。如何通过代码更改来实现同样的功能?有其他的命令能帮助我吗?
所以你想'TabHost'高于'ImageView'?如何在XML中将“TabHost”移动到它上面? –
没有雅诺,我希望我的图片在页面顶部(公司徽标),然后是TabHost – Vinoth
没有雅诺,我希望我的图片位于页面顶部(公司徽标),然后是TabHost – Vinoth