S
S
Shadrindmitry2019-08-20 18:28:12
Android
Shadrindmitry, 2019-08-20 18:28:12

Why is the button missing?

ImageButton wrapped in LinearLayout disappears on a 5.5 inch Android 5.1.1 small screen phone. What could be the problem?

<LinearLayout
            android:layout_width="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_height="fill_parent" >
            
            <View
                android:layout_width="0dp"
                android:layout_height="64dp"
                android:layout_weight="1" />

            <ImageButton
                android:layout_width="0dp"
                android:layout_height="64dp"
                android:layout_weight="1"
                android:id="@+id/photoView_cancel"
                android:padding="8dp"
                android:scaleType="centerInside"
                android:background="?android:attr/selectableItemBackground"
                android:src="@drawable/ic_photo_cancel" />

            <ImageButton
                android:layout_width="0dp"
                android:layout_height="64dp"
                android:layout_weight="1"
                android:id="@+id/photoView_revert"
                android:layout_marginLeft="32dp"
                android:layout_marginRight="32dp"
                android:padding="8dp"
                android:scaleType="centerInside"
                android:background="?android:attr/selectableItemBackground"
                android:src="@drawable/ic_photo_retry" />

            <ImageButton
                android:layout_width="0dp"
                android:layout_height="64dp"
                android:layout_weight="1"
                android:id="@+id/photoView_ok"
                android:padding="8dp"
                android:scaleType="centerInside"
                android:background="?android:attr/selectableItemBackground"
                android:src="@drawable/ic_photo_confirm" />
            
            <View
                android:layout_width="0dp"
                android:layout_height="64dp"
                android:layout_weight="1" />
        </LinearLayout>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2019-08-20
@onepavel

I guess because of the fixed sizes of the elements, the button is pushed off the screen

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question