lixplor / android-Q-A

🐞 android related questions and answers
0 stars 0 forks source link

ViewPager放在自定义控件中显示不出来 #69

Closed lixplor closed 7 years ago

lixplor commented 7 years ago

ViewPager放在自定义控件中显示不出来

lixplor commented 7 years ago

原因: 还是继承了ViewGroup, Linearlayout等相关容器布局时, inflate没有传this 解决: View.inflate(context, R.layout.view, this);