<View
android:layout_width="match_parent"
android:layout_height="2dip"
android:background="#FF909090"
android:layout_marginLeft="40dip"
android:layout_marginRight="40dip"
android:layout_marginTop="10dip" />

转载http://www.cnblogs.com/henryxu/archive/2013/04/10/3012081.html

//android获取屏幕的高度和宽度用到WindowManager这个类,两种方法:
//第一种
WindowManager wm = (WindowManager) getContext()
.getSystemService(Context.WINDOW_SERVICE); int width = wm.getDefaultDisplay().getWidth();
int height = wm.getDefaultDisplay().getHeight();
//第二种
WindowManager wm = this.getWindowManager(); int width = wm.getDefaultDisplay().getWidth();
int height = wm.getDefaultDisplay().getHeight();

android Xml生成一条细线,以及获取屏幕宽度和高度的更多相关文章

  1. Android获取屏幕宽度、高度的4种方法

    记录学习之用,有相同的问题可以参考 方法一: WindowManager wm = (WindowManager) this .getSystemService(Context.WINDOW_SERV ...

  2. 【转】android获取屏幕宽度和高度

    原文网址:http://www.cnblogs.com/howlaa/p/4123186.html 1. WindowManager wm = (WindowManager) getContext() ...

  3. android获取屏幕宽度和高度

    1. WindowManager wm = (WindowManager) getContext() .getSystemService(Context.WINDOW_SERVICE); int wi ...

  4. android 获取屏幕宽度和高度

    // 获取屏幕宽高(方法1) int screenWidth = getWindowManager().getDefaultDisplay().getWidth(); // 屏幕宽(像素,如:480p ...

  5. Js获取屏幕宽度、高度

    document.body.clientWidth ==> BODY对象宽度 document.body.clientHeight ==> BODY对象高度 document.docume ...

  6. Android 自学之进度条ProgressBar

    进度条(ProgressBar)也是UI界面中的一种非常使用的组件,通常用于向用户显示某个耗时完成的百分比.因此进度条可以动态的显示进度,因此避免长时间地执行某个耗时操作时,让用户感觉程序失去了响应, ...

  7. Android - XML序列化

    1.xml文件的序列化:采用XmlSerializer来实现XML文件的序列化.相比传统方式,更高效安全 MainActivity.java package com.example.test_buil ...

  8. Android xml 格式 随笔

    打包的时候Android xml文件会由字符格式(utf-8编码)转换为二进制格式.具体如:http://blog.csdn.net/jiangwei0910410003/article/detail ...

  9. 【转】24. android dialog ——ProgressDialog 进度条对话框详解

    原文网址:http://blog.csdn.net/jamesliulyc/article/details/6375598 首先在onCreateDialog方法里创建一个ProgressDialog ...

随机推荐

  1. request.getParamer()

    eturns the value of a request parameter as a String, or null if the parameter does not exist. Reques ...

  2. 玩sdr的朋友们,在rtl_tcp时,记得调整rtl_AGC和tuner_AGC啊

    我在rtl_tcp时没有调整这个,结果怎么也听不到声音啊 还有就是在搞rtl_tcp时,一定要网速跟得上,我用无线网络时就碰到了这个问题,声音总是一直断续着,郁闷死

  3. Clojure操作mysql

    在Eclipse中新建一个Clojure工程clj01 clojure 操作mysql需要依赖mysql-connector-java.clojure-contrib与java.jdbc三个jar包. ...

  4. HttpWebResponse类

    HttpWebResponse类的作用用于在客户端获取返回的响应的信息,还记得HttpResponse类吗?你是否在写B/S程序的时候,经常用到Response.Write()呢? HttpRespo ...

  5. Go代理,修改标题

  6. jprofiler安装和配置

    转:http://www.cnblogs.com/adolfmc/archive/2013/06/09/3129358.html 注意:安装前先用rpm -q jprofiler查询linux上是否已 ...

  7. View not attached to window manager crash 的解决办法

    View not attached to window manager crash 的解决办法 转自:http://stackoverflow.com/questions/22924825/view- ...

  8. OpenWrt编译

    OpenWrt编译简单过程1,OpenWrt编译环境准备sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoco ...

  9. formidable上传图片

    function uploadfiles(res, req){ var form = new formidable.IncomingForm(); form.parse(req,function(er ...

  10. Android日语输入法Simeji使用示例

    MainActivity如下: package cn.testsimeji; import android.os.Bundle; import android.view.View; import an ...