【发布时间】:2016-09-10 18:42:12
【问题描述】:
我正在尝试在 android 中制作一个选项卡小部件,它填充布局宽度并直接放置在我的活动的操作栏下方,但我的选项卡小部件周围的白色边距阻止我实现我的视图,所以任何人都可以请帮我从我的主要相对布局周围删除这些边距(在下面的图片链接中用红色标记)?
以下是我的 xml 代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="left"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.idm.ui.MainActivity" >
<TabHost
android:id="@+id/tabHost"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:adjustViewBounds="true"
android:layout_marginTop="-16dp"
android:layout_marginLeft="-15dp"
android:layout_marginRight="-17dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#000000">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="fill_vertical|center"
android:showDividers="none" >
</TabWidget>
</LinearLayout>
<LinearLayout
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:id="@+id/tab1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/elvDownloading"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
</RelativeLayout>
<RelativeLayout
android:id="@+id/tab2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="@+id/elvDownloaded"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
</RelativeLayout>
</FrameLayout>
</LinearLayout>
</LinearLayout>
</TabHost>
提前致谢
【问题讨论】: