I have a Imagebutton, a horizontal Line which should be under the imagebutton and below this horizontal line I have a Textview.
Somehow, I can't center the Imagebutton, despite using android:gravity="center"
And also I can't set the horizontal line between Imagebutton and TextView. Please help
about.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="@+id/imageButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="32dp"
android:background="@drawable/roundcorner"
android:gravity="center"
app:srcCompat="@drawable/ic_launcher" />
<View
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="#c0c0c0"
android:foregroundGravity="center_horizontal"
android:layout_alignParentTop="true" />
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="1dp" />
</LinearLayout>