I have an Linear Layout with horizontal orientation
Within that I have image on left side and textview on right side .
How to align those image and textview in the center horizontal without using margin?
Here is my code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android
rientation="horizontal"
android:background="@drawable/menu_colors"
android:gravity="center_horizontal"
>
<ImageView
android:id="@+id/menuimg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/film"
android:layout_gravity="center_horizontal"
/>
<TextView
android:id="@+id/menutext"
android:layout_width="match_parent"
android:layout_height="40dp"
android:text="TextView"
android:gravity="center_vertical"
/>
</LinearLayout>
Within that I have image on left side and textview on right side .
How to align those image and textview in the center horizontal without using margin?
Here is my code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android
rientation="horizontal"android:background="@drawable/menu_colors"
android:gravity="center_horizontal"
>
<ImageView
android:id="@+id/menuimg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/film"
android:layout_gravity="center_horizontal"
/>
<TextView
android:id="@+id/menutext"
android:layout_width="match_parent"
android:layout_height="40dp"
android:text="TextView"
android:gravity="center_vertical"
/>
</LinearLayout>