35十包宽高
16lz
2021-01-26
ApplicationFramework层
ActivityManager
PackageManager
WindowManager
TelphonyManager
ContentProvider
ResourceManager
ViewSystem
LocationManager
NotificationManager
XMPPService
获取LinearLayout的长宽
View view = getLayoutInflater().inflate(R.layout.main, null);
LinearLayout linearLayout = (LinearLayout) view.findViewById(R.id.linearLayout);
linearLayout.measure(0, 0);
int width = linearLayout.getMeasuredWidth();
int height = linearLayout.getMeasuredHeight();
获取按钮在屏幕上的坐标
View view = findViewById(R.id.button1);
int[] locations = new int[2];
view.getLocationOnScreen(locations);
int x = locations[0];
int y = locations[1];
更多相关文章
- Android判断网络是否连接
- android Button的应用
- iOS的Alerts与Android的Dialogs
- 给Android标题栏加上返回按钮
- android编译时报错
- cocos2d-x获取设备信息
- android请求权限
- Android第十五天 ContentProvider之ContentResover
- Android--fragment从activity中获取数据