Tôi đang tạo chế độ xem tìm kiếm của riêng mình cho Android 2.3.Đã xảy ra lỗi trong bán kính Góc Android
Tôi có.
LinearLayout
(Ngang)AutoCompleteTextView
ImageButton
tôi đã thêm nút và AutoCompleteTextView
để LinearLayout
.
Tôi muốn đặt bán kính góc trong điều khiển của chính tôi như hình ảnh được hiển thị bên dưới.
tôi đặt drawable này để ImageButton
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true" >
<shape>
<solid
android:color="#27AFE0" />
<stroke
android:width="0.5dp"
android:color="#000000" />
<corners
android:topRightRadius="10dp" android:bottomRightRadius="10dp"
android:topLeftRadius="0.1dp"
android:bottomLeftRadius="0.1dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item>
<shape>
<solid android:color="#D3DBDE"/>
<stroke
android:width="0.5dp"
android:color="#000000" />
<corners
android:topRightRadius="10dp" android:bottomRightRadius="10dp"
android:topLeftRadius="0.1dp"
android:bottomLeftRadius="0.1dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
drawable để AutoCompleteText
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#D3DBDE"/>
<stroke android:width="0.5dp" android:color="#000000"/>
<corners android:topLeftRadius="10dp"
android:bottomLeftRadius="10dp"
android:topRightRadius="0.1dp"
android:bottomRightRadius="0.1dp"/>
</shape>
</item>
Nhưng khi tôi chạy này trong android 2.3 này là sản phẩm (Emulator và Real Device)
Nếu tôi cũng chạy Android 4.0. Nó hoạt động tốt.
Câu hỏi là có gì sai trong mã của tôi? Hoặc có lỗi trong Android 2.3?
Các góc có thể vẽ ImageButton có topRightRadius và bottomRightRadius được xác định hai lần. Đó có phải là lỗi đánh máy không? Và việc sử dụng một phần của dp là gì? – Rajesh
@Rajesh Vâng, tôi xin lỗi. Bạn sẽ thấy lý do tại sao tôi đã sử dụng 0.1dp trên liên kết này http://stackoverflow.com/questions/3056232/how-to-make-a-shape-with-left-top-round-rounded-corner-and-left-bottom -rounded-c –