2021年4月28日星期三

Circular button with drawable in the middle

I'm currently making the layout of an app I'm working on and I'm not able to create this button in xml.

Circular Button

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:

Bad circular button

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

https://stackoverflow.com/questions/67309749/circular-button-with-drawable-in-the-middle April 29, 2021 at 09:06AM

没有评论:

发表评论