我希望我的图表占据 100% 的 View ,我只想查看图表。我想删除那个空白。但我得到了这个结果:
这是我的 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: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.example.debitdistance.WifiChartsRealTime$PlaceholderFragment" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/chart" >
</LinearLayout>
</RelativeLayout>
最佳答案
从 RelativeLayout
中删除填充:
<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"
tools:context="com.example.debitdistance.WifiChartsRealTime$PlaceholderFragment" >
...
</RelativeLayout>
这些都是没有100%填满屏幕的原因。
关于Android:LinearLayout 占据 100% 的 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23593401/