Edit: Sorry es war ein Problem in meiner Implementierung, das Layout Gewicht war nicht 1 und damit das Problem. Es funktionierte, nachdem ich das Layout Weight repariert habe.Android: Text zentriert nicht in TextView?
Ich weiß nicht warum, aber ich bin nicht in der Lage, Text in diesem custom TextView zu zentrieren, kann jemand bitte helfen. Ich habe verschiedene Dinge ausprobiert, aber keine funktioniert. Das Symbol in meiner IconTextView ist näher rechts und nicht in der Mitte. Vielen Dank !!
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.25">
<com.malinskiy.materialicons.widget.IconTextView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ripple_effect"
android:gravity="center"
android:text="{zmdi-play}"
android:textColor="#ffffff"
android:textSize="40dp"
app:hacky_preview="true" />
</LinearLayout>
Screenshot freigeben. –