title: Android Studio - setBackground()
body: <p>When I'm creating a TextView, and I'm seting the size I would like to set the background to a drawable using setBackground or setBackgroundResource, however whenever I do it, it changes the size of the background. It doesn't do it if I create a view in the XML file, though.   </p>
  
  <pre><code>Drawable drawable = getResources().getDrawable(R.drawable.gold_edged);
      mEventView.setBackground(drawable);
      mEventView.setLayoutParams(layoutParams);
      mEventView.setPadding(24,0,24,0);
      mEventView.setWidth(LayoutParams.MATCH_PARENT);
      mEventView.setHeight((int)(height*context.getResources().getDisplayMetrics().density));
      //mEventView.setBackgroundColor(Color.parseColor("#ffffff"));
      mEventView.setTextColor(Color.parseColor("#000000"));
      mEventView.setText(message);
  </code></pre>
  
  <p>This is the code, and when setBackgroundColor isn't commented out it goes back to the original sizes but I do not want that color as the background.</p>