有两个textview是紧挨在一起的,但是文字是动态生成的,也就是字数是在变的,所以没有放在一起显示,分别设置了两个textview,但是需求是说这两个需要放在一起,紧挨着才行,所以得消除掉他们之间的空隙才行,找了网上的方式如下:

android:layout_marginLeft="-10px" 可以消除两个控件之间的默认空隙!!!!


我的示例如下:


<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal" >


<TextView
android:id="@+id/orderhis_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#fffffdfd"
android:textSize="20dp" />


<TextView
android:id="@+id/orderhis_price"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="-10px"
android:textColor="#fffffdfd"
android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>

红色部分是重点,希望记录一下,对有些人有用。


======================================使四个按钮始终居于布局的底部 2015年11月30日15:08:43:=====================

<LinearLayout        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_alignParentBottom="true"        android:layout_centerHorizontal="true"        android:orientation="horizontal" >        <Button            android:id="@+id/reset"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_weight="1"            android:text="Reset" />        <Button            android:id="@+id/remove"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_weight="1"            android:text="Remove" />        <Button            android:id="@+id/confirm"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_weight="1"            android:text="OK" />        <Button            android:id="@+id/cancel"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_weight="1"            android:text="Cancel" />    </LinearLayout>


更多相关文章

  1. Android(安卓)SDK Samples,学习Android的好方法
  2. Android(安卓)RGB颜色转换 iOS的UIColor
  3. AndEngine引擎学习之环境配置以及示例修改
  4. ADB 使用详细教程——Awesome Adb
  5. Android(安卓)OkHttp的Cookie自动化管理
  6. 腾讯微博java(android) sdk 标签相关api详细介绍
  7. Android(安卓)AOP 之 javassist 示例
  8. android-studio adb命令大全
  9. android 滚动条颜色设置(android Progressbar color)

随机推荐

  1. Android(安卓)面试题总结之Android(安卓)
  2. android文字阴影效果
  3. Android(安卓)指纹启动流程
  4. 如何将Android例子程序添加到Eclipse进行
  5. Android(安卓)ListView 去除边缘阴影、选
  6. 【Android布局】在程序中设置android:gra
  7. 调用android system Search UI须注意的问
  8. Android(安卓)动态加载(四) - 简单demo实现
  9. Android之抽屉效果(自定义、GridView、Sli
  10. Android(安卓)基本控件 View 类的常用xml