<RelativeLayout android:id="@+id/title_rLayout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:background="@drawable/bg_title" android:padding="0sp"> <ImageView android:id="@+id/title_image" 
android:layout_centerInParent="true" android:layout_width="wrap_content"
 android:layout_height="wrap_content" /></RelativeLayout>外层 relativeLayout 的的背景图 bg_title  尺寸  480x73
ImageView 中 title_image 的尺寸 60 x 34按理说 relativeLayout  最后的高度应该是 73啊为啥程序中打印出来是 110? ps: 界面中图片的高度明显变高了。  很不解.请教。  这是为神马

解决方案 »

  1.   

    组件的宽和高分别是由android:layout_width="fill_parent" 和android:layout_height="wrap_content"
    决定的。而不是有背景图的尺寸决定的。你可以把android:layout_height="wrap_content"
    改成android:layout_height="73px"试一试
      

  2.   

    这个还真不好算
    要根据LCD Density换算控件的单位是px 实际图片的单位好像不是用的px
    不同Density会打印不同的值  查下图片用的是什么单位了
    找到个换算的
    http://blog.csdn.net/xieyan0811/article/details/5931561