Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want to add icon on Button, drawableTop is not working Android

I want to add call icon on Button but drawableTop is not working.

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="60dp">
        <Button
            android:id="@+id/imageView3"
            android:layout_width="wrap_content"
            android:drawableTop="@android:drawable/ic_menu_call"
            android:layout_height="match_parent"
            android:layout_weight="1" />
    </LinearLayout>

enter image description here

like image 484
Abhishek Avatar asked Jan 27 '26 15:01

Abhishek


1 Answers

Replace your Button with AppCompatButton

<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="60dp">

        <android.support.v7.widget.AppCompatButton
            android:id="@+id/imageView3"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:drawableTop="@android:drawable/ic_menu_call"/>
</LinearLayout>
like image 116
karan Avatar answered Jan 30 '26 03:01

karan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!