admin管理员组文章数量:1355731
I want to create a button which has rounded corners and uses a wood texture as its style, something similar to this
I have tried with ImageButtons, LayerLists and nothing has worked so far. The current implementation that doesn't break everything is this piece of code, where the '@drawable/wood' is the texture file.
<FrameLayout
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_margin="16dp"
android:layout_rowWeight="1"
android:layout_columnWeight="1">
<ImageButton
android:id="@+id/button25"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/wood"
android:contentDescription="25€"
android:scaleType="centerCrop" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="25€"
android:textColor="@android:color/white"
android:textSize="150sp"
android:textStyle="bold" />
</FrameLayout>
本文标签: How to create a rounded corner button with an imageAndroidStack Overflow
版权声明:本文标题:How to create a rounded corner button with an image? - Android - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744048383a2581962.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论