AlertDialog中的垂直滚动条

时间:2013-01-04 09:20:20

标签: android android-layout

我想在警告对话框中显示垂直滚动条可能很快。因为它包含数千个要显示的数据。

AlertDialog.Builder builder = new AlertDialog.Builder(
                PublishingPublisher.this);
        builder.setTitle("Select following:");
    //  builder.setFastScrollEnabled(true); // can i have like this something.

2 个答案:

答案 0 :(得分:0)

如果您想在listView中显示alertDialog,则会显示滚动条:

builder.setView(<YourListView>);

答案 1 :(得分:0)

事实上!你必须制作自定义警报Dialog,其中包含你的对话框中包含数千个数据的列表视图,如下所示:

LayoutInflater inflater = ((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE));
View customView = inflater.inflate(R.layout.dialog_row, null, false);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(customView);
相关问题