tacen

Results 8 comments of tacen

![微信图片_20190830092759](https://user-images.githubusercontent.com/30254002/63986921-a3cfeb00-cb08-11e9-9788-096c49864eab.jpg)

![微信图片_20190830093745](https://user-images.githubusercontent.com/30254002/63987206-daf2cc00-cb09-11e9-9813-d2efbc7b5675.jpg) 一开始是这样的排版,全屏返回后出现这个情况,tablayout不见了 ![微信图片_20190830093741](https://user-images.githubusercontent.com/30254002/63987241-04135c80-cb0a-11e9-9cd5-7f8f50dbd3cf.jpg)

不就下载不来吗,那么想办法下载就好了,我们会给谷歌安装一些插件来加速下载github的项目,然后在自己当前项目去执行这段指令git ls-remote -h -t https://github.com.cnpmjs.org/nhn/raphael.git,就下载成功,然后在npm i就成功了。 ![image](https://user-images.githubusercontent.com/30254002/119802192-ee1a1200-bf10-11eb-9ff2-836f5b39d44f.png)

继承后,加个类 public void setpos(int current_tab_position){ this.current_tab_position=current_tab_position; },然后在调用这个控件的actvity里写:mDropDownMenu.setpos(0); mDropDownMenu.setTabText(type_pos == 0 ? headers[0] :types[type_pos]); mDropDownMenu.closeMenu();

可以的,你继承后,把DropDownMenu.class类的代码全部复制到你的自定义的类,然后在你自定义的类加我给你的方法。我已经实现了,你可以看看DropDownMenu.class里的代码,理解一下就可以了

> > 继承后,加个类 public void setpos(int current_tab_position){ > > this.current_tab_position=current_tab_position; > > },然后在调用这个控件的actvity里写:mDropDownMenu.setpos(0); > > mDropDownMenu.setTabText(type_pos == 0 ? headers[0] :types[type_pos]); > > mDropDownMenu.closeMenu(); > > 这样做还是不可以默认选中啊。。。 可以的,你继承后,把DropDownMenu.class类的代码全部复制到你的自定义的类,然后在你自定义的类加我给你的方法。我已经实现了,你可以看看DropDownMenu.class里的代码,理解一下就可以了

我贴代码给你吧,public class MyDropDownMenu extends DropDownMenu { private LinearLayout tabMenuView; private FrameLayout containerView; private FrameLayout popupMenuViews; private View maskView; private int current_tab_position; private int dividerColor; private int textSelectedColor; private int textUnselectedColor;...

current_tab_position这个值,要点击控件才不是-1,所以我们使用的时候,传值给它