Yash Chowdhary
Yash Chowdhary

Reputation: 185

Difference in Layout Preview and actual device

I don't understand why, but the text in my textView in the actual device (on running) does not have the same size as my layout preview.

This is the snippet from my XML file for the text view:

<TextView
    android:id="@+id/tournament_text_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="TOURNAMENTS"
    android:layout_marginTop="8dp"
    android:layout_gravity="center"
    android:textColor="#CDDC39"
    android:textStyle="bold"
    tools:textSize="40sp"/>

Here's the difference: enter image description here

Upvotes: 0

Views: 94

Answers (1)

Jaydeep Devda
Jaydeep Devda

Reputation: 735

use app instead of tools in tools:textSize

tools is for design-time features such as which layout to show in a fragment) or compile-time behaviors, such as which shrinking mode to apply to your XML resources

check out for more details : https://developer.android.com/studio/write/tool-attributes.html

Upvotes: 1

Related Questions