androidxmlandroid-layoutaudacity

android xml udacity gap between the sides of the screen


I have this problem while using https://labs.udacity.com/android-visualizer/, I can't move the bottom buttons (from the left, bottom side, that it wouldnt be stuck to the sides of the screen but had a bit of a gap.I added the picture, those are the buttons with white background, foto ->Sides

   <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#2b580c">

    <TextView
        android:textStyle="bold"
        android:text="VTMC - Mūsų nuotraukos"
        android:layout_width="match_parent"
        android:layout_height="70dp"
        android:textColor="@android:color/white"
        android:textSize="22sp"
        android:background="#2b580c"
        android:gravity="center"



        />
     <ImageView
        android:layout_width="wrap_content"
        android:layout_height="300dp"
        android:scaleType="centerCrop"
        android:src="@drawable/grass"/>

     <Button
       android:textStyle="bold"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:gravity="center"
       android:text="Atgal"
       android:background="#FFFFFF"
          android:textSize="20sp"
         android:padding="4dp"
         android:layout_alignParentBottom="true"
          android:layout_alignParentLeft="true"




         />
      <Button
    android:textStyle="bold"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"

    android:gravity="center"
    android:text="Kitas"
    android:background="#FFFFFF"
           android:textSize="20sp"
               android:padding="4dp"
    android:layout_alignParentBottom="true"
          android:layout_alignParentRight="true"




         />







</LinearLayout>

Solution

  • From what I understand you want the buttons to be in the bottom corners yet have some space between the buttons and the corner of the screen.

    Add a margin to the buttons

    android:layout_margin="(size)"
    

    If you want to customize if further you can add a margin to the right,left,bottom, or top.