android text not showing in button

android, android-layout, android-relativelayout

Solution

I had this problem, I solved it by chaning the xml for the button from using tools: to android: for the text attribute. Example below (last line is the line thats changed):

 <Button
            android:id="@+id/btn_settings"
            style="@style/Widget.AppCompat.Button.Borderless"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:textColor="#F6F6F6"
            tools:text="App Settings" />

becomes...

 <Button
            android:id="@+id/btn_settings"
            style="@style/Widget.AppCompat.Button.Borderless"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:textColor="#F6F6F6"
            android:text="App Settings" />

Problem

This happens very frequently to me when starting to work on android. The text within the button element is not showing fully. What can be wrong? I tried text direction, alignment, gravity but nothing works. The code behind it: ``` <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textView1" android:layout_centerHorizontal="true" android:layout_marginTop="40dp" android:text="@string/latestButtonString" android:background="@drawable/roundbutton" /> ``` Please help and much appreciated. Update: This is the roundbutton.xml: ``` <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp"> <!-- you can use any color you want I used here gray color--> <solid android:color="#ABABAB"/> <corners android:bottomRightRadius="10dp" android:bottomLeftRadius="10dp" android:topLeftRadius="10dp" android:topRightRadius="10dp"/> </shape> ```

Original source