title: Android - Button text size for all screen sizes
body: <p>I am developing an android app where I have 3 buttons at the top of the screen and i have defined them using the <code>layout_weight</code> property. The buttons adjust to all screen sizes including tablets but its text does not.</p>
  
  <p>This is what it looks like on a <strong>nexus 5</strong>:</p>
  
  <p><img src="https://i.imgur.com/BcUkq2e.png?1" width="337" height="200"></p>
  
  <p>This is what it looks like on a <strong>nexus 10</strong>:</p>
  
  <p><img src="https://i.imgur.com/608dqCH.png?1" width="537" height="350"></p>
  
  <p>See the difference?<br>
  On the nexus 5, It is quite legible but on the nexus 10 you can hardly see anything!<br></p>
  
  <p>Here is my <strong>XML</strong>:</p>
  
  <p></p>
  
  <pre><code>&lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_gravity="center_vertical"
      android:layout_weight="1"
      android:background="#000000"
      android:orientation="horizontal"
      android:weightSum="3" &gt;
  
      &lt;Button
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:text="Button 1"
          android:layout_weight="1"
          android:id="@+id/button" /&gt;
  
      &lt;Button
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:text="Button 2"
          android:layout_weight="1"
          android:id="@+id/button2" /&gt;
  
      &lt;Button
          android:layout_width="wrap_content"
          android:layout_height="fill_parent"
          android:text="Button 3"
          android:layout_weight="1"
          android:id="@+id/button3" /&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_gravity="center_vertical"
      android:background="#000000"
      android:layout_weight="1"
      android:orientation="horizontal"
      android:weightSum="3" &gt;
  
  &lt;/LinearLayout&gt;
  
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_gravity="center_vertical"
      android:layout_weight="1"
      android:background="#000000"
      android:orientation="horizontal"
      android:weightSum="3" &gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_gravity="center_vertical"
      android:layout_weight="1"
      android:background="#000000"
      android:orientation="horizontal"
      android:weightSum="3" &gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_gravity="center_vertical"
      android:layout_weight="1"
      android:background="#000000"
      android:orientation="horizontal"
      android:weightSum="3" &gt;
  
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_gravity="center_vertical"
      android:layout_weight="1"
      android:background="#000000"
      android:orientation="horizontal"
      android:weightSum="3" &gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>So how do I get the button text size to adjust automatically on different screen sizes without having to make different layouts for different screen sizes?</strong><br></p>
  
  <p>Please help me out with the code as I am pretty much a beginner!</p>
  
  <p>Thanks in advance!</p>