简体   繁体   English

调用show()之后,在对话框片段中修改膨胀的膨胀视图

[英]Modfiying inflated inflated view in a dialogfragment after calling show()

Let's say you have a dialogfragment with a listView . 假设您有一个带有listViewdialogfragment The title of the dialog is a custom view which is inflated in onCreateDialog() . 对话框的标题是一个自定义视图,该视图在onCreateDialog()被放大。 Is it possible to toggle visibility of the inflated view when the list item is clicked. 单击列表项时是否可以切换膨胀视图的可见性。

In the onCreateDialog() function, you can hold the dialog view which referencing to title view which you want to toggle on. 在onCreateDialog()函数中,您可以保存对话框视图,该对话框视图引用要打开的标题视图。 On click event of listview. 列表视图的单击事件。

lv.setOnItemClickListener(new OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position,long id) {
//Toggle your title here
    }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM