【发布时间】:2019-02-23 06:23:15
【问题描述】:
我的代码有问题吗?
round_corner.xml(我把它放在drawable中)
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#FFFF0F" />
<corners android:radius="30dp" />
</shape>
我认为我的 imageButton 中的代码不起作用
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="5dp">
<ImageButton
android:id="@+id/my_button"
android:layout_width="match_parent"
android:layout_height="170dp"
android:layout_gravity="center"
android:background="@drawable/round_corner"
android:src="@drawable/my_pic"/>
</LinearLayout>
它没有给我任何错误。它只是没有让我的形象变得圆润。有什么想法吗?
【问题讨论】:
-
你想要圆形图像按钮?
-
是的,但没用
-
@ dexter : 我试过了但是没用所以我在这里问。