我用下面的布局(缩短):为什么textviews不可见?
<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> s]中没有出现的按钮行为应该如何应用。
我在忽略什么?谢谢!
tablerow的覆盖其子女layout_width和layout_height属性。 – pouzzler