title: How can avoid text from being cut off on a button?
body: <p>I am customizing a button in Android changing its background (using a 9patch png file) and changing its font typeface. I put the button in a <code>RelativeLayout</code> since I need precise positioning and dimensioning of this item in a custom layout. I am doing all this programmatically (from creation to setting and display).</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/8242005/why-is-my-buttons-text-cut-off">this question</a> with the same problem, but the solution will not work for me. I used</p>
  
  <pre><code>continueBtn.setPadding(0,0,0,0);
  </code></pre>
  
  <p>but the graphical output remains the same. More than half the text is cut off in the view.</p>
  
  <p>An excerpt of the code I am using is the following:</p>
  
  <pre><code>Button continueBtn = new Button(getContext());
  p = new RelativeLayout.LayoutParams(width, 45);
  p.addRule(CENTER_HORIZONTAL);
  
  continueBtn.setLayoutParams(p);
  continueBtn.setTypeface(...);
  continueBtn.setTextSize(14);
  outerLayout.addView(continueBtn);
  continueBtn.setPadding(0, 0, 0, 0);
  </code></pre>
  
  <p>No matter where I put the <code>setPadding</code> method call, things won't change.
  What am I doing wrong? Any ideas?</p>