Reputation: 285
I am using android text view to display the constant data in manifest.XML file, I need to display the text like this 80% But now it displays 80.
Here is my text view widget can you please help to me.`
<TextView
android:text="80" />
Upvotes: 2
Views: 4191
Reputation: 1704
<TextView android:text="80%"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
Upvotes: 0
Reputation: 12733
if you want to display percentage in xml file then you have to use strings.xml file for that like below:
<string name="percent_sign">80%</string>
use this string in your layout file for display percentage:
android:text="@string/percent_sign" />
or
android:text="80%" />
instead of
android:text="80" />
Upvotes: 2
Reputation: 809
If you want to display percentage symbol in TextView
you just need add "%" symbol in your XML layout:
android:text="80%"
or in your java :
TextView.setText("80%");
Upvotes: 0