Issue
I'm currently making the layout of an app I'm working on and I'm not able to create this button in xml.
The arrow inside is a .png picture (I can also get it exported as vector) and the background is just a drawable. I am unable to mix this two assets to make this button. My current result is this:
The xml is:
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/onboardingStep2NextButton"
android:layout_width="50dp"
android:layout_height="50dp"
app:layout_constraintTop_toBottomOf="@id/onboardingStep2SubTitle"
android:src="@drawable/long_left"
android:background="@drawable/purple_round_background"
app:layout_constraintEnd_toEndOf="parent"/>
purple_round_background.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
<corners android:radius="50dp"/>
<solid android:color="@color/purple" />
</shape>
Thanks for any help
Solution
try to add android:padding
may help you:
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/onboardingStep2NextButton"
android:layout_width="50dp"
android:layout_height="50dp"
app:layout_constraintTop_toBottomOf="@id/onboardingStep2SubTitle"
android:src="@drawable/long_left"
android:background="@drawable/purple_round_background"
app:layout_constraintEnd_toEndOf="parent"
android:padding="10dp"
/>
Answered By - shirley
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.