0

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>

2 Answers2

0

Delete

android:layout_alignParentBottom="true"
          android:layout_alignParentLeft="true"

from first button and

android:layout_alignParentBottom="true"
          android:layout_alignParentRight="true"

from second one.

MMG
  • 3,226
  • 5
  • 16
  • 43
  • but then it's just a line across the screen – Karolis Gumbis May 18 '20 at 11:05
  • Yes, it won't be at the bottom of screen. What do you want to have? @KarolisGumbis – MMG May 18 '20 at 11:06
  • The other answer that Aditya Kurkure gave worket, those buttons need to be in that scale but not stucked in the screen corner, but have a gap between the screen corner, I've got the answer, but thank you for your reply – Karolis Gumbis May 18 '20 at 11:08
0

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.

Aditya Kurkure
  • 422
  • 5
  • 19
  • @KarolisGumbis please accept this answer if it worked. So that people don't come to this again thinking still there are no accepted answers... Thanks.. – AgentP May 18 '20 at 11:31
  • @PraveenSP, yes sorry, had to wait a bit till I could "accept" the answer. – Karolis Gumbis May 18 '20 at 11:41