私はレイアウトが違っています。 xmlによって作成されたものもあります。他のいくつかはコードを介してdinamically。私がXML上にあるとき、幅または高さを "wrap_content"値で設定できます。どのように同じ結果をdinamically得るか?これは私のダイナミックTextViewのスニペットです。私は "最終int幅= 440;を削除する必要があります同じ値の "wrap_content"を取得します。どうやって?android:layout_width = "match_parent"をコードから設定する方法は?
final int width = 440;
final int height = textViewHeight;
final int top = getNewTop(height);
FrameLayout.LayoutParams layoutParams;
layoutParams = getLayoutParams(width, height, top);
TextView textView;
textView = new TextView(_registerNewMealActivity);
textView.setText(text);
textView.setLayoutParams(layoutParams);
_frameLayout.addView(textView);
>>>これを試して? – sensorario