خرید بک لینک

Vote count: 0

I currently have 4 ImageButtons in a layout that takes only half of the screen height. I would like the ImageButtons to be placed evenly in the layout. Here is what I have:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">

    <ImageButton
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:src="@mipmap/feed_button"
        android:background="@android:color/transparent"
        android:layout_weight="1" />

    <ImageButton
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:src="@mipmap/feed_button"
        android:background="@android:color/transparent"
        android:layout_weight="1" />

</LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="40dp"
    android:orientation="horizontal">

    <ImageButton
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:src="@mipmap/feed_button"
        android:background="@android:color/transparent"
        android:layout_weight="1" />

    <ImageButton
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:src="@mipmap/feed_button"
        android:background="@android:color/transparent"
        android:layout_weight="1" />

</LinearLayout>

</LinearLayout>

This works, since here is the result:

enter image description here

The issue is, 1: I would like to add text under each button and I am not sure how that is going to work and 2: the white spots to the right and left of the ImageButtons are active, as if they were parts of the button. Is there a better way to do this?

asked 21 secs ago

برچسب: نویسنده: استخدام کار تاريخ: چهارشنبه 9 تير 1395 ساعت: 9:50

صفحه بندی