码迷,mamicode.com
首页 > 移动开发 > 详细

安卓EditText按钮

时间:2016-07-30 18:08:02      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:

main.xml

<?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"
    >
    <TextView  
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:text="@string/hello"
        />
    
   <!--hint 表示提示信息,在输入框中会有提提示 -->
   <!-- fill_paren宽度延长到整个屏幕 -->
   <!-- wrap_content高度与字体相对,包裹字体  --> 
   <!--inputType输入数据类型,此时表示输入的是电话号码  -->
   <!-- background输入框的形状设置,设置参数跳转到drawable/shape里设置 -->
    <EditText
   
        android:hint="我是EditText"              
        android:layout_width="fill_parent"     
        android:layout_height="wrap_content"  
        android:inputType="phone"  
        android:background="@drawable/shape"  
         
        />    
    
</LinearLayout>

shape.xml

<?xml version="1.0" encoding="UTF-8"?>
<shape 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <!-- 填充的颜色 -->
    <solid android:color="#FFFFFF" />
    <!-- 设置矩形的四个角为弧形 -->
    <!-- android:radius 弧形的半径 -->
    <corners android:radius="7dip" />
</shape> 

 

安卓EditText按钮

标签:

原文地址:http://www.cnblogs.com/yihujiu/p/5721186.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!