Android textview gravity center
I have this layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#222222"
android:gravity="center_horizontal"
android:layout_gravity="center_horizontal"
android:paddingBottom="5dp">
<SeekBar
android:layout_width="200dp"
android:layout_height="wrap_content"
android:id="@+id/seekbar"
android:max="5"
android:progress="2">
</SeekBar>
<TextView android:id="@+id/fontsize00"
android:layout_width="25dp"
android:layout_height="25dp"
android:gravity="center"
android:layout_marginLeft="20dp"
android:text="C"
android:textSize="20dp"
android:background="#FFFFFF"
android:textColor="#222222">
</TextView>
</LinearLayout>
The text size changes as the counter value changes. Even if low values ββplace the text in the center of the text, high values ββset it lower. Why is this happening?
+3
source to share
2 answers