
Untitled
By: a guest on
Jul 29th, 2012 | syntax:
None | size: 0.66 KB | hits: 13 | expires: Never
Android: TextView Background Drawable - Allow height of 0?
public class HelloAndroid extends Activity implements View.OnClickListener{
TextView btn;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
btn = new TextView(this);
btn.setOnClickListener(this);
//Put in any drawable of you in here
btn.setBackgroundDrawable(getResources().getDrawable(R.drawable.restablebg5));
btn.setHeight(80);
LinearLayout v = new LinearLayout(this);
v.setOrientation(LinearLayout.VERTICAL);
v.addView(btn);
setContentView(v);
}
public void onClick(View arg0) {
btn.setHeight(0);
}