简体   繁体   中英

Make Android Button Chamfered Corner

Is it possible to make chamfered corner in Android Button like this (pointy corner)??

在此处输入图片说明

All reference i've searched is to create rounded corner, not chamfered.

Please help. Thank you for any answer.

You can use Button and set this image as background android:background="@drawable/chamfered_edge_img" (i hav used above image as chamfered_edge_img, u can use same image without text and add text to button with android:text="My Button Name" )

Code:

<Button
        android:layout_width="150dp"
        android:layout_height="50dp"
        android:scaleType="fitXY"
        android:background="@drawable/lcoyg"
        style="?selectableItemBackground"
        />

Result:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM