加一个 android:layout_marginTop
解决方案 »
- android文件存储求助!!!
- 我的Eclipse中只有Android Project from existing code没有Android Project
- 调用.net的webservice
- android 如何让一张图片在屏幕上做无规律的运动
- Android调用Web页面,实现手机客户端图片上传及定位
- 用android 获取当前本地文件、文件夹,并显示在listview上,点击文件夹,显示该文件夹下的文件和文件夹?详解
- DrawerLayout主界面被导航界面覆盖
- Android中怎么解析html字符串或页面
- Android Layout的问题
- Android okhttp3 rx retrofit2 编码的问题
- 我想做一个通过WIFI同步的应用
- 谁比较懂jquery mobile
@ birdsaction 谢谢版主的回复
添加了后,可以有间距了。但是如图所示
在第一个 imageview 添加了android:layout_marginTop ="0.01dp" (对应m距离)
在第一个 edittext 添加 android:layout_marginTop ="0.01dp"(对应L距离)
第二个edittext添加android:layout_marginTop ="10dp" (对应n距离))为什么 10dp 对应的距离 n 会比 0.01dp对应的距离L 和n 要小的多呢?
另外 怎么把 m距离减少呢?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="10px"
android:layout_width="fill_parent"
android:layout_height="wrap_content" > <ImageView
android:id="@+id/btn_logo"
android:src="@drawable/btn_logo"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginTop ="0.01dp"
android:layout_centerHorizontal="true"
/>
<EditText android:id="@+id/login_account"
android:paddingLeft="10.0sp"
android:saveEnabled="true" android:layout_width="fill_parent"
android:layout_height="60sp"
android:layout_marginLeft="5.0dip"
android:layout_marginRight="5.0dip"
android:hint="@string/strInputAccHint"
android:maxLength="10"
android:layout_below ="@id/btn_logo"
android:background = "@drawable/edittext_style"
android:layout_marginTop ="0.01dp"
android:inputType="number" />
<EditText android:id="@+id/login_pwd"
android:paddingLeft="10.0sp"
android:saveEnabled="true" android:layout_width="fill_parent"
android:layout_height="60sp"
android:layout_marginLeft="5.0dip"
android:layout_marginRight="5.0dip"
android:maxLength="10"
android:layout_below ="@id/login_account"
android:background = "@drawable/edittext_style"
android:layout_marginTop ="10dp"
android:inputType="number" />
<ImageButton android:id="@+id/btn_login"
android:background="@drawable/btn_login" android:clickable="true"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_below="@id/login__pwd"
android:layout_centerVertical="true"
android:layout_marginLeft="5.0dip"
android:layout_marginRight="5.0dip"
android:layout_marginTop ="10dp"
android:layout_gravity="center_vertical|center_horizontal" />
</RelativeLayout>