如何获得Android的System Bar’s Height
来源:互联网 发布:sudoers ubuntu 编辑:程序博客网 时间:2024/06/08 06:03
package com.sample.layouttest;import android.app.Activity;import android.os.Bundle;import android.util.Log;import android.view.View;import android.view.View.OnLayoutChangeListener;public class Main extends Activity implements OnLayoutChangeListener { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); View newView = getLayoutInflater().inflate(R.layout.main, null); newView.addOnLayoutChangeListener(this); setContentView(newView); } @Override public void onLayoutChange(View view, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { Log.d("LayoutTest","left="+left+", top="+top+", right="+right+", bottom="+bottom); }}
On a Motorola Xoom running Android 3.1 (as well as a Samsung Galaxy 10.1V running 3.0), the output from the onLayoutChange method when entering portrait mode is :
05-24 15:11:43.047: DEBUG/LayoutTest(8658): left=0, top=0, right=800, bottom=1232
and when entering landscape :
05-24 15:13:18.837: DEBUG/LayoutTest(8658): left=0, top=0, right=1280, bottom=752
- 如何获得Android的System Bar’s Height
- Android Translucent System Bar 的最佳实践
- Android ToolBar+Translucent System Bar的用法
- Android ToolBar+Translucent System Bar的用法
- Android如何获得系统(system)权限
- Android如何获得系统(system)权限
- Android如何获得系统(system)权限 !!!
- Android如何获得系统(system)权限
- Android如何获得系统(system)权限
- Android如何获得系统(system)权限
- Android如何获得系统(system)权限
- 【android】隐藏title bar和system navigation bar,status bar
- 改变 Android System bar 颜色
- Android开发:Translucent System Bar
- Android开发:Translucent System Bar 的最佳实践
- Android开发:Translucent System Bar 的最佳实践
- Android Design Support Library--Translucent System Bar 的最佳实践
- Android开发:Translucent System Bar 的最佳实践
- Delphi连接SQL Server 2000
- 在UltraEdit (UEStudio)使用技巧及其中的正则表达式
- Android Robotium实例
- 在企业内部门户如何构建社区应用?
- hdu1124
- 如何获得Android的System Bar’s Height
- 多线程知识点整理
- [IT 男人帮 11-15] Think Different:烛照未来
- 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
- 静态代码块
- 修正android 处理连续按键两次
- 数据库实验二
- python_对字典进行排序
- 对象调用成员的过程