请问登录界面的问题

gdutqiang 2014-12-12 06:13:41
请问以下的登录界面是怎么弄的呢?(就是 输入密码的输入边框跟屏幕有一段小距离,输入框的四个角有个小圆弧,输入框里边的颜色跟外表的有点不同,请问外边是不是要有个background呢
另外,按钮登录是一个imageview,怎么样这个图片填充满这个手机的宽度(跟手机边框有点小距离),这个imageview要怎么设置呢?需要多大的图片?

麻烦会的朋友详细回答,先谢啦
...全文
156 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
gdutqiang 2014-12-12
  • 打赏
  • 举报
回复
请会的朋友也帮忙回复下吧 谢谢啦
gdutqiang 2014-12-12
  • 打赏
  • 举报
回复
引用 2 楼 icyblood198999 的回复:
登录的按钮,不要设置宽度,设置横向充满,然后margin左右各xxdp 密码输入框其实就是EditText,然后setbackground,上面锁的图片可以用relativelayout 然后放一个imageview。
@icyblood198999 请问为什么我以下在androidmanifest设置达不到它的效果的呢? <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <RelativeLayout android:id="@+id/RelativeLayout02" android:layout_width="fill_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/login_edit_account" android:paddingLeft="45.0sp" android:saveEnabled="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="5.0dip" android:layout_marginTop="5.0dip" android:layout_marginRight="5.0dip" android:layout_marginBottom="5.0px" android:hint="@string/strInputAccHint" android:maxLength="10" android:layout_alignParentTop="true" android:inputType="number" /> <TextView android:textSize="16.0dip" android:textColor="#ff3f3f3f" android:gravity="center_vertical" android:id="@+id/TextView01" android:paddingLeft="7.0sp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="15.0sp" android:text="密码" android:layout_alignLeft="@+id/login_edit_account" android:layout_alignTop="@+id/login_edit_account" android:layout_alignBottom="@+id/login_edit_account" /> </RelativeLayout> <ImageButton android:id="@+id/btn_login" android:background="@drawable/btn_login" android:clickable="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_gravity="center_vertical|center_horizontal" /> <TextView android:textSize="16.0dip" android:textColor="#ff3f3f3f" android:gravity="center_vertical" android:id="@+id/TextView05" android:paddingLeft="7.0sp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="游客登录" android:layout_gravity="center_vertical|center_horizontal" /> </LinearLayout>
icyblood198999 2014-12-12
  • 打赏
  • 举报
回复
登录的按钮,不要设置宽度,设置横向充满,然后margin左右各xxdp 密码输入框其实就是EditText,然后setbackground,上面锁的图片可以用relativelayout 然后放一个imageview。
harkue 2014-12-12
  • 打赏
  • 举报
回复
输入密码的输入边框跟屏幕有一段小距离 使用android:layout_marginTop="10dp"属性(RelativeLayout)或者android:marginTop="10dp"(LinearLayout)。 登录按钮其实可以通过Button来实现,定义一个Selector文件,在<shape>中定义: <corner> : 定义边框圆角 <solid>:填充背景色-蓝色 手机屏幕的左右边距,类似android:layout_marginTop="10dp"有android:layout_marginLeft 和 android:layout_marginRight属性。 具体的值可以通过Eclipse快捷键 Alt+/进行查看。
落幕-无悔 2014-12-12
  • 打赏
  • 举报
回复
还有就是输入字体距文本框你设置android:padding=""。还不懂你就百度下文本框的属性吧
落幕-无悔 2014-12-12
  • 打赏
  • 举报
回复
LZ你的需求就是EditText文本宽需要4个角为圆角并有边框,这个你可以在drawable写个xml样式,在用background调用你写的样式就可以啊; xml样式如下:
<?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
    <corners android:radius="6dp"/> <!-- 圆角角度 -->
    <solid android:color="@color/bg_white"/> 
    <stroke android:color="@color/bg_white" android:width="0.4dp"/> <!-- 边框颜色与边框大小 -->
</shape>
布局调用
<EditText
                    android:id="@id/edittext2"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="10dp"  //这个地方就是你所需要的距离手机边缘距离
                    android:layout_marginRight="10dp" //这个地方就是你所需要的距离手机边缘距离
                    android:background="@drawable/edit_style"
                     />
imageview布局
<ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:src="@drawable/image"
                android:layout_marginLeft="10dp"  //这个地方就是你所需要的距离手机边缘距离
                android:layout_marginRight="10dp" //这个地方就是你所需要的距离手机边缘距离
                android:scaleType="fitXY"
                />
登陆按钮建议你用button
名字要长一点 2014-12-12
  • 打赏
  • 举报
回复
你写个button,然后写个selector。让btn的背景选用这个selector。btn的宽度改成充满布局,然后设置margin属性。

80,353

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧