简体   繁体   中英

Modfiying inflated inflated view in a dialogfragment after calling show()

Let's say you have a dialogfragment with a listView . The title of the dialog is a custom view which is inflated in 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. 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
    }
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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