Change touch radius of a toggle button
I have a circular toggle button that has the touch radius of a square - as
shown by the blue box:
How do I make it so the touch radius is only on the image? Here's my XML
for the ToggleButton:
<ToggleButton
android:layout_width="380dp"
android:layout_height="340dp"
android:shape="oval"
android:background="@layout/powerbutton"
android:id="@+id/powerButton"
android:textOn=""
android:textOff=""
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"/>
I have tried to add android:radius="100dp", android:shape="oval", defined
the shape in another XML file, and scoured the internet to see if anything
would fix it, but haven't had any luck. Below is what I have attempted in
another XML file:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" android:padding="10dp">
<corners
android:bottomRightRadius="10dp"
android:bottomLeftRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp"/>
Anybody know what could be going wrong?
No comments:
Post a Comment