Charles Jonasson
Charles Jonasson

Reputation: 97

Why does XML text doesn't change Size even though i've changed them?

As the title says i've changed the size to 24 on a button calle "Publish". However it's sticking to it's default size which i don't know. I'll post the entire XML code incase there's something unknown i don't know about. Thanks!

Also i'm using relative layout if that makes any difference. Here's a gyazo picture since i myself love when people include pictures in their problems: https://gyazo.com/7fb92ecb6a2b64446fddb913fe9e5db7

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".TrashAway">

    <Button
        android:id="@+id/button2"
        android:layout_width="297dp"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="Add Image" />

    <Button
        android:id="@+id/publishButton"
        android:layout_width="297dp"
        android:layout_height="66dp"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="128dp"
        android:text="Publish"
        tools:textSize="24sp" />

    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="77dp">

        <android.support.design.widget.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Title" />
    </android.support.design.widget.TextInputLayout>

    <android.support.design.widget.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="173dp">

        <android.support.design.widget.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Description" />
    </android.support.design.widget.TextInputLayout>

    <Button
        android:id="@+id/goBackBtnTA"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentStart="true"
        android:layout_marginBottom="23dp"
        android:layout_marginStart="22dp"
        android:text="Back to start" />

</RelativeLayout>

Upvotes: 2

Views: 79

Answers (1)

Lucem
Lucem

Reputation: 3082

You are using the wrong attribute. Use android:textSize="24sp" And your button should change

        <Button
            android:id="@+id/publishButton"
            android:layout_width="297dp"
            android:layout_height="66dp"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="128dp"
            android:text="Publish"
            android:textSize="24sp" />

Upvotes: 2

Related Questions