Tôi muốn tạo ra một Button
mà trông như thế này:Làm thế nào để tạo ra một nút tròn với một lớp phủ góc
Đây là những gì tôi đã cố gắng cho đến nay:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="60dp"
android:layout_height="60dp"
android:background="#00000000">
<ImageButton
android:id="@+id/btnPinterest"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="-5dp"
android:contentDescription="@null"
android:scaleType="fitCenter"
android:src="@drawable/pinterest"/>
<TextView
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_marginTop="0.5dp"
android:background="@drawable/notification"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:text="@string/btnPinterest"
android:textColor="#FFFFFF"
android:textSize="12sp"/>
</RelativeLayout>
Nhưng Tôi không hài lòng, nó không giống như Button
tôi đã trình bày ở trên. Ví dụ: văn bản một văn bản quá gần. Bất cứ ai có thể giúp tôi sao chép này Button
chính xác hơn?
Nếu bất cứ ai cần nó, đây là hình ảnh overlayed:
Bạn có thể chỉnh sửa hình ảnh về những gì bạn hiện có trong câu hỏi của mình không? Điều đó sẽ giúp việc hiểu vấn đề dễ dàng hơn nhiều. –
Bạn có thể sử dụng chỉ một ImageButton duy nhất và ghi đè lên đó là gọi lại onDraw để tự vẽ phần tử góc. – Luksprog
@all: cảm ơn tất cả – Javier