私は次のレイアウトを使用します(短縮):
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" ...>
<TableRow ...>
<TextView
android:id="@+id/sell_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/sell" />
<SeekBar
android:id="@+id/sell"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</TableRow>
</TableLayout>
このように(短縮も):
LayoutInflater inflater = parent.getLayoutInflater();
View layout = inflater.inflate(R.layout.merger_sale, null);
AlertDialog.Builder builder = new AlertDialog.Builder(parent);
builder.setTitle(R.string.sell_stock_after_merger)
.setView(layout)
.setPositiveButton(R.string.sell_all, new OnClickListener() {...
.setNeutralButton(R.string.trade_sell, new OnClickListener() {...
.setNegativeButton(R.string.trade_all, new OnClickListener() {...
AlertDialog dialog = builder.create();
dialog.show();
レイアウトにエラーはなく、コードにもエラーはありません。レイアウトは、Eclipseのレイアウトエディタに表示されるとおりに表示されます。ダイアログは表示されるべきときに表示され、ボタンは表示されないtexview(@ + id / Sell_text)[および短縮された<TableRow>内の他のテキストビュー]を除いて、本来の動作をします。
私は何を見落としていますか?ありがとう!