本帖最后由 oathevil 于 2013-07-26 17:15:33 编辑

解决方案 »

  1.   

    用 weight,来设定,按照比例分配
      

  2.   

    参考下吧,个人感觉layout_weight="1"等分的时候有用,其他时候就不太好控制了。
    另外textsize用px做单位文本大小也没法拉伸,用sp比较好。
          <LinearLayout android:id="@+id/inputbar_others_container"
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content"> 
        <Button
            android:id="@+id/swich_to_symbol"
            android:background="@drawable/inputbar_btton_bg"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:layout_alignParentBottom="true"
            android:clickable="true"/>
        <ImageButton
            android:id="@+id/inputbar_setting"
            android:background="@drawable/inputbar_btton_bg"
            android:src="@drawable/setting"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:layout_alignParentBottom="true"
            android:clickable="true"/>
         <ImageButton
            android:id="@+id/inputbar_tohand"
            android:background="@drawable/inputbar_btton_bg"
            android:src="@drawable/hand"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:layout_alignParentBottom="true"
            android:clickable="true"/>
         <ImageButton
            android:id="@+id/inputbar_speech"
            android:background="@drawable/inputbar_btton_bg"
            android:src="@drawable/mic"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:layout_alignParentBottom="true"
            android:clickable="true"/>
         <ImageButton
            android:id="@+id/inputbar_close"
            android:background="@drawable/inputbar_btton_bg"
            android:src="@drawable/to_hard_ime"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:layout_alignParentBottom="true"
            android:clickable="true"/>
          </LinearLayout>
      

  3.   

    最后发现了是AndroidMainfest.xml里面的<uses-sdk android:minSdkVersion="1" />在作怪,发现在值为1,2,3的时候都自适应, 但在8或者8以后的都会错位。
    (注:4、5、6、7没有尝试)查了下原因,大概是,
    随着Android版本的更新,有些界面的风格也开始变化。如果想保持早期低版本时的风格,那么minSdkVersion就应该被设置为相应的sdk版本。我想这差不多是较为合理的解释了,希望对初学者会有帮助。
      

  4.   

    布局中控件的位置不要用绝对坐标,尽量用相对位置来控制,图片用scaleType属性来控制,不考虑拉伸可以设置为fitXY