Question

I would like that my chart takes 100% of the view, I just want to see the chart. I would like to remove that blank. But I'm getting this result:

enter image description here

And this is my XMl layout :

 <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>
Was it helpful?

Solution

Remove the paddings from 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>

These are the reason of not 100% filling the screen.

OTHER TIPS

Remove these lines:

android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"

or change the value of activity_horizontal_margin and activity_vertical_margin to 0dp

The containing RelativeLayout declares padding. set all padding values to 0dp to remove "the blank".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top