user54517
user54517

Reputation: 2420

Android - textview doesn't show up

enter image description here

For some reason, my textview Add a base doesn't show up when I launch the app on my phone. I have no idea why, 'cause it is displayed on Android studio :O

enter image description here

Upvotes: 0

Views: 36

Answers (2)

Mohit Dholakia
Mohit Dholakia

Reputation: 252

tools:text="YOUR TEXT" can be used for your design and preview purpose. If you add any text as a tools:text app will not use this text as that is not the actual text that should be rendered on the app

So instead of this, you should use android:text="YOUR TEXT"

Upvotes: 1

Saurabh Thorat
Saurabh Thorat

Reputation: 20634

Replace tools:text="@string/add_base" with android:text="@string/add_base"

Attributes in the tools namespace are shown only when designing layouts. When you build your app, the build tools remove these attributes so there is no effect on your APK size or runtime behavior.

Reference: https://developer.android.com/studio/write/tool-attributes

Upvotes: 2

Related Questions