[置顶] Android(安卓)去掉两个textview的空隙
有两个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>
更多相关文章
- Android(安卓)SDK Samples,学习Android的好方法
- Android(安卓)RGB颜色转换 iOS的UIColor
- AndEngine引擎学习之环境配置以及示例修改
- ADB 使用详细教程——Awesome Adb
- Android(安卓)OkHttp的Cookie自动化管理
- 腾讯微博java(android) sdk 标签相关api详细介绍
- Android(安卓)AOP 之 javassist 示例
- android-studio adb命令大全
- android 滚动条颜色设置(android Progressbar color)