我使用下面的代码设计了圆形按钮,然后我想在按钮上显示一些文本,所以我使用了框架布局,然后在我的按钮上放置了一些文本。 现在Challange是我的按钮仍然是。它没有显示任何影响点击 其中drawable和src都用于圆形按钮和其他按钮上的图像(respectivitly)。如何在Imagebutton上点击
现在我的按钮不会对设计产生任何影响,请点击我如何实现该效果。
<FrameLayout>
<ImageButton
android:id="@+id/btn_profile_view"
android:layout_width="70dp"
android:layout_height="67dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="20dp"
android:layout_weight="1"
android:onClick="compareButtonClick"
android:background="@drawable/roundedbutton"
android:src="@drawable/ic_action_person" />
<TextView
android:layout_width="45dp"
android:layout_height="20dp"
android:layout_gravity="bottom"
android:layout_marginLeft="38dp"
android:clickable="false"
android:text="@string/profile"
android:textColor="@color/btn_txt" >
</TextView>
</FrameLayout>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#D3D3D3" />
<corners
android:bottomLeftRadius="8dip"
android:bottomRightRadius="8dip"
android:topLeftRadius="8dip"
android:topRightRadius="8dip" />
为什么你还没有指定framelayout尺寸属性? – Abhishek
并显示你的代码,你正在试图获得onclick回拨 – Abhishek
我不需要框架布局属性,因为我把我的框架布局放在表格布局中,表格行布局和我在重量单行上使用重量显示3图像按钮表行中的属性。 – user3719634