获得activity的rootview
来源:互联网 发布:什么赚钱软件最好 编辑:程序博客网 时间:2024/06/05 14:46
@NonNull public static FrameLayout getRootFrame(@NonNull Activity activity) { View re = activity.findViewById(android.R.id.content); if (re != null && re instanceof FrameLayout) { return (FrameLayout) re; } ViewGroup viewGroup = (ViewGroup) activity.getWindow().getDecorView(); re = viewGroup.getChildAt(viewGroup.getChildCount() - 1); if (re != null && re instanceof FrameLayout) { return (FrameLayout) re; } else { re = new FrameLayout(activity); activity.getActionBar().getHeight(); ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT , ViewGroup.LayoutParams.MATCH_PARENT); viewGroup.addView(re, lp); return (FrameLayout) re; } }
0 0
- 获得activity的rootview
- activity 获取 rootView 设置 backGroundColor
- android 从Activity 获取 rootView 根节点
- android 从Activity 获取 rootView 根节点
- 自定义View-获取界面的rootview
- 获得当前可见的Activity
- 获得activity的类名
- 算法把rootview中所有的button改变背景
- ARC下 pop到Rootview 中间controller的内存控制
- android获得正在运行的activity
- 从启动的activity中获得结果
- 获得当前运行的activity名字
- 如何获得当前正在展示的activity
- Activity获得新打开的Activity的数据
- DecorView, RootView, ContentView图示
- 获得当前正在显示的activity的类名
- 获得当前正在显示的activity的类名
- Activity获得焦点----onWindowFocusChanged
- HDU 5665 Lucky
- C#序列化与反序列化总结
- Ubuntu安装hadoop2.7.1----伪分布搭建
- view的分层显示
- 高斯消元模板
- 获得activity的rootview
- UVA 1001 Say Cheese(最短路)
- 很奇怪的bootclasspath参数 同文章里说的一样,也没有搞清楚 为什么需要显式地指定一下-bootclasspath
- HDU 5666 Segment
- STM32的FATFS文件系统移植的debug过程
- 越来越好玩的C语言,输出的*
- Deep Learning(深度学习)整理,RNN,CNN,BP
- hadoop平台搭建(2)--jdk的安装及配置
- Server Tomcat v8.0 Server at localhost failed to start. 问题解决方法?