EditText与TextView和BUtton结合使用
2011-09-15 10:11
381 查看
我想要的效果:
![](http://hi.csdn.net/attachment/201109/15/0_131605081692y2.gif)
![](http://hi.csdn.net/attachment/201109/15/0_13160508522E3t.gif)
第一张图片是一个EditText和TextView的结合,第二张图片是EditText和Button的结合。
效果挺好吧 呵呵
第一章图片布局文件
<LinearLayout android:orientation="horizontal" android:background="@color/login_input" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_marginTop="138dp" android:layout_marginRight="10dp"> <ImageView android:background="@color/login_head" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <RelativeLayout android:paddingRight="10dp" android:paddingTop="10dp" android:layout_width="wrap_content" android:layout_height="wrap_content"> <EditText android:id="@+id/l_eTxt_name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="@string/input_name" android:textColorHint="#50000000" android:text="admin" android:paddingLeft="50dp" android:layout_marginBottom="10.0dp" android:maxLines="1"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/name" android:textSize="15.0sp" android:textColor="#ff3f3f3f" android:layout_marginLeft="5dp" android:layout_alignLeft="@+id/l_eTxt_name" android:layout_alignTop="@+id/l_eTxt_name" android:layout_alignBottom="@+id/l_eTxt_name" android:gravity="center_vertical" /> <EditText android:id="@+id/l_eTxt_pwd" android:layout_below="@+id/l_eTxt_name" android:layout_alignLeft="@+id/l_eTxt_name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputType="textPassword" android:hint="@string/input_password" android:textColorHint="#50000000" android:text="21232F297A57A5A743894A0E4A801FC3" android:paddingLeft="50dp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/password" android:textSize="15.0sp" android:textColor="#ff3f3f3f" android:layout_marginLeft="5dp" android:layout_alignLeft="@+id/l_eTxt_pwd" android:layout_alignTop="@+id/l_eTxt_pwd" android:layout_alignBottom="@+id/l_eTxt_pwd" android:gravity="center_vertical" /> </RelativeLayout> </LinearLayout>
第二张图片的布局文件
<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/Com_seek_eTxt_name" android:hint="@string/input_company_name" android:textColorHint="#FDC9BC" android:maxLines="2" android:layout_height="wrap_content" android:layout_width="fill_parent"></EditText> <Button android:id="@+id/Com_seek_Btn_seek" android:layout_alignRight="@+id/Com_seek_eTxt_name" android:layout_marginRight="3dp" android:layout_centerVertical="true" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/seek"></Button> </RelativeLayout>
相关文章推荐
- Android的常见控件(TextView、EditText、Button、Menu)使用
- Android入门(三):使用TextView、EditText 和Button接口组件
- 常用控件的使用的方法(TextView、Button、EditText、ImageView、ProrgressBar)
- TextView ,EditText,Button ,Menu四个常用控件 的使用方法
- CoordinatorLayout 、FloatingActionButton 、Snackbar、DrawerLayout和NavigationView结合使用demo
- Android开发8:UI组件TextView,EditText,Button
- 使用代码为TextView或者Button设置drawableLeft,top,ringht,buttom
- Android TextView结合SpannableString使用大全
- Android学习(一)TextView,ImageView,Button,EditText,控件
- 通过RTLabel、RCLabel、FTCoreText及webView结合SDWebImage等4种方式实现左滑或下拉中cell中图文混排使用场景方案
- 使用AutoCompleteTextView 做edittext自动提示
- Android开发-EditView, Button, TextView的简单使用
- android学习中关于Textview,Button,EditText,连接的设置,Intent,Activity不同状态等的一系列基础知识点
- 安卓Design包之NavigationView结合DrawerLayout,toolbar的使用,FloatingActionButton
- Android TextView结合SpannableString使用大全
- 通过RTLabel、RCLabel、FTCoreText及webView结合SDWebImage等4种方式实现左滑或下拉中cell中图文混排使用场景方案
- SQLite与AutoCompleteTextView结合使用
- android Button,textView 等控件设置控件内嵌周围图片使用方法
- Android开发8:UI组件TextView,EditText,Button
- 基本的UI组件(TextView、EditText、Button、ImageView、SeekBar)学习