亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

java - 多個(gè)活動(dòng)使用同一個(gè)Drawerlayout(如何封裝基類?)
大家講道理
大家講道理 2017-04-18 10:54:49
0
3
634

如題,多個(gè)活動(dòng)使用同一個(gè)drawerlayout,想問怎么封裝基類?

因?yàn)槲蚁隿lick事件效果都一樣,感覺沒必要再寫一遍,想問一下

  1. 如何封裝基類

  2. 基類子類布局文件怎么寫?

大家講道理
大家講道理

光陰似箭催人老,日月如移越少年。

reply all(3)
小葫蘆

A relatively simple method can be to extract the layout in the drawer into a Fragment, expose the corresponding interface and data, and dynamically add it to a new activity each time

Ty80

First of all, you need to be clear about what you want to encapsulate? Yes drawerlayout,所有你可以自定義一個(gè)類繼承drawerlayout,在其中可以就可以做許多事情,例如你的需求:進(jìn)行統(tǒng)一的click操作。使用的話可以直接在任何類(自然包括基類如果必要的話)的布局中使用自定義的drawerlayout.

大家講道理

If this is the case, you can put the click event or something in the parent class. The parent class is an abstract class. The DrawerLayout method of filling the layout calls the abstract method written by the parent class and is implemented by the subclass itself

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template