2011-09-14 6 views
1

私はViewクラスがaddViewメソッドを持っていない、このビューすなわちVオブジェクトのビューのaddView()メソッドが表示されない、つまり、下のコードにありますか?

public class MyviewActivity extends Activity { 
    /** Called when the activity is first created. */ 

    @Override 
    public void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.main); 
     LayoutInflater inflater=this.getLayoutInflater(); 
     View v=inflater.inflate(R.layout.main, null, true);//view 
    } 
} 

答えて

6

に動的にボタンを追加します。 ViewGroupLinearLayoutなど)を拡張する基本クラスのいずれかを使用する必要があります。

関連する問題