0

プログラム的には、次のように定義されたRelativeLayoutand (タイトルと呼ばれる) があります。TextView

RelativeLayout layout = new RelativeLayout(this);
final RelativeLayout.LayoutParams parameters_title = 
      new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, 
                                       RelativeLayout.LayoutParams.WRAP_CONTENT);  
title.setLayoutParams(parameters_title);
layout.addView(title,parameters_title);

これからどんどん追加していきたいと思いtextviewsますbuttons。しかし、今のところ、 を に変換するために、RelativeLayoutを aに「変換」したいと思います (言葉にする方法がわかりません) 。このように使おうとしましたが、うまくいきませんでしたViewWindowManagerLayoutInflater

LayoutInflater layoutInflater = 
       (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
myView = layoutInflater.inflate(layout, null );

次に、目標はthroughにmyView入れることです。からを取得するにはどうすればよいですか?WindowMangeraddViewViewRelativeLayout

4

2 に答える 2