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