2012-11-22 27 views

回答

0

也許會更容易只顯示/隱藏它。使用setVisibility(value),值可以是View.GONE,View.INVISIBLEView.VISIBLE

2

這裏有一個例子:

(On按鈕點擊)

LinearLayout linearLayout = (LinearLayout) findViewById(R.id.mylayout) 
TextView txt1 = new TextView(MyClass.this); 
linearLayout.setBackgroundColor(Color.TRANSPARENT); 
linearLayout.addView(txt1); 
+0

嘿謝謝fr信息我當我點擊切換到關閉狀態時也需要textview消失 – sagar

相關問題