0

I wanna put my logo to my app and layout_gravity doesn't work, neither found in Android Studio why? maybe there is another option for this, maybe by version i don't know, below I share the code in XMl.

<ImageView
   android:layout_gravity="center"
   android:layout_width="140dp"
   android:layout_height="140dp"
   android:src="@drawable/logo" />

Mustafa Poya
  • 2,615
  • 5
  • 22
  • 36

1 Answers1

1

if you using parent layout <RelativeLayout> and try android:centerInParent="true" or android:layout_centerVertical="true" (center vertical) , android:layout_centerHorizontal="true" (center horizontal) in <ImageView> and if you use parent layout <LinearLayout> try android:layout_gravity="center"

myst
  • 51
  • 2