在Fragment 里面关于ViewPagerIndicator设置样式(Style)不起作用
来源:互联网 发布:飞鱼网络电视看不了 编辑:程序博客网 时间:2024/04/28 05:15
在Fragment里面加入了一个三方开源组件ViewPagerIndicator,可是设置的样式就是不起作用,在Activity里面一点问题都没有 。。
在Fragment的 onCreateView中以前都是直接这么就可以获得View...
@Override
public View onCreateView(LayoutInflaterinflater, ViewGroupcontainer,Bundle savedInstanceState){
// TODO Auto-generated method stub
View view= inflater.inflate(R.layout.activity_layout,container,false);
findView(view);
return view;
}
但是这样是不行的,布局里面的设置了style也是不起作用。
解决办法如下:@Override
public View onCreateView(LayoutInflaterinflater, ViewGroupcontainer, Bundle savedInstanceState){
Context context= new ContextThemeWrapper(getActivity(), R.style.StyledIndicators);
// clone the inflater using the ContextThemeWrapper
LayoutInflater localInflater=inflater.cloneInContext(context);
View view= localInflater.inflate(R.layout.course_fragment,container, false);
return view;
}
这样里面的style起作用了,希望能帮到你。
- 在Fragment 里面关于ViewPagerIndicator设置样式(Style)不起作用
- 设置Fragment的Style
- 给Fragment设置style
- 给Fragment设置Style
- js在设置角标的时候因为浏览器默认样式(User Agent Stylesheet)不起作用
- jQuery动态设置样式(style、css)
- js 设置 style 样式
- 自己看的,随便写,贴。关于Android里面的Style(样式)和主题(Theme)资源
- Android ViewPagerIndicator下划线颜色、样式设置
- 关于Fragment里面嵌套fragment
- 在fragment里面嵌套fragment
- JS 获取style 里面的样式
- javascript 动态设置样式style
- android style设置控件样式
- android 样式style的设置
- Dialog style文件设置样式
- QT 中继承QWidget之后,样式表不起作用 style stylesheet
- 设置ActionBar在不同平台上Button的样式(Setting ActionBar Button style based on platform )
- 判断是否是变形字符串
- CCDT与CDT
- 浅析C++中的重载运算符(重点是重载+=)
- C++之 构造函数 拷贝构造函数 析构函数 赋值操作
- genymotion的一个小错误
- 在Fragment 里面关于ViewPagerIndicator设置样式(Style)不起作用
- Lesson01UIView 用户界面
- 录制音频
- NoSQL数据库是否适用于非互联网行业
- bestcoder#58 Inversion 即 hdu5497 (树状数组维护逆序数)
- 开源分布式计算系统框架比较
- MacOS配置Erlang开发环境
- UVa11300 - Spreading the Wealth
- POJ2947 Widget Factory 高斯消元+扩展GCD解同余方程组