安卓EditText按钮

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> 
时间: 2024-08-14 09:18:07

安卓EditText按钮的相关文章

(Unity)Unity实现类似于安卓原生项目的点击安卓返回按钮回到前一页的功能

本章博主和大家一起讨论下Unity怎么实现类似安卓原生项目,点击安卓返回按钮实现返回到前一个页面的功能. 1.定义一个泛型用于响应安卓的返回按钮 public static List<GameObject> list; public GameObject addPanel;                     //添加首页 2.在Start方法中将首页压入栈中 list = new List<GameObject>(5); //将页面压入堆栈中 list.Add(addPane

安卓EditText中姓名为空时提醒报错

1 if(name_a.getText().toString().trim().equals("")){ 2 new AlertDialog.Builder(ActivityA.this) 3 .setTitle("警告").setMessage("姓名输入不能为空,请重新输入!!!") 4 .setPositiveButton("确定", null).show(); 5 return; 6 7 }else{ 8 age_a.

安卓 将按钮放置透明布局文件下

在xml中,标签从上到下的排列顺序,决定了在手机屏幕上的,位于上下层的顺序 如:<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_

安卓EditText显示与隐藏密码

首先,有一个EditText和CheckedBox,在xml里面设置EditText的android:inputType="textPassword",为CheckedBox添加事件监听, @Override public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) { // TODO Auto-generated method stub if (isChecked) { mPswEdt.setI

android 安卓edittext自动弹出数字键盘

et.setFocusable(true); et.setFocusableInTouchMode(true); et.setInputType(EditorInfo.TYPE_CLASS_NUMBER);  Timer timer = new Timer(); timer.schedule(new TimerTask() { public void run()  { InputMethodManager inputManager =(InputMethodManager)et.getConte

ReactNative入门(安卓)——API(上)

Alert - 弹窗 通过 Alert.alert() 方法调用唤起原生弹窗,点击会触发 onPress 回调(参考下方代码)并清除弹窗. import React, { AppRegistry, Component, StyleSheet, Alert, Text, View } from 'react-native'; class AwesomeProject extends Component { componentDidMount(){ Alert.alert( 'Alert标题', '

(安卓)基本的UI控件和布局文件知识要点

文本控件 - TextView - EditText 按钮控件 - Button - ImageButton状态开关按钮 - ToggleButton 单选与复选按钮 - CheckBox - RadioButton 图片控件 - ImageView 时钟控件 - AnalogClock - DigitalClock 日期与时间选择控件 - DataPicker - TimePicker 布局文件: LinearLayout和RelativeLayout 共有属性:java代码中通过btn1关联

50款巧夺天工的PSD按钮素材

1.两款白色安卓滑动按钮PSD素材 下载地址>>> 2.黑色质感音量调节旋钮PSD素材 下载地址>>> 3.苹果风格导航按钮PSD素材 下载地址>>> 4.各种逼真的旋钮开关和指示器PSD素材 下载地址>>> 5.黑色质感音量调节器PSD素材 下载地址>>> 6.圆角水晶按钮素材PSD分层文件 下载地址>>> 7.四款国外社交网站分享按钮PSD素材 下载地址>>> 8.带指示灯的左

学习进度10

  第十周 所花时间(包括上课) 6H 代码量(行) 100 博客量(篇) 0 了解到的知识 1.整理了 文本框:TextView.EditText 按钮:Button.RadioButton.RadioGroup.CheckBox.ImageButton 列表:List.ExpandableListView.Spinner.AutoCompleteTextView.GridView.ImageView 进度条:ProgressBar.ProgressDialog.SeekBar.RatingB