首页 > 移动平台 > 详细

【2】安卓学习之控件和布局

时间:2014-12-03 23:28:36      阅读:362      评论:0      收藏:0      [点我收藏+]

更新中。。。


控件:

一、button

拖一下,拉一下,图形化操作即可

bubuko.com,布布扣


按钮相应:

bubuko.com,布布扣

bubuko.com,布布扣



本次问题汇总:

一、

android开发过程中突然发现的warning

EditText 报出 “This text field does not specify an inputType or a hint”


原因:
EditText需要指定默认输入类型
加入android:inputType="number|phone",表示指定为数字或电话

inputtype类型如下:
    android:inputType="none"
    android:inputType="text"
    android:inputType="textCapCharacters"
    android:inputType="textCapWords"
    android:inputType="textCapSentences"
    android:inputType="textAutoCorrect"
    android:inputType="textAutoComplete"
    android:inputType="textMultiLine"
    android:inputType="textImeMultiLine"
    android:inputType="textNoSuggestions"
    android:inputType="textUri"
    android:inputType="textEmailAddress"
    android:inputType="textEmailSubject"
    android:inputType="textShortMessage"
    android:inputType="textLongMessage"
    android:inputType="textPersonName"
    android:inputType="textPostalAddress"
    android:inputType="textPassword"
    android:inputType="textVisiblePassword"
    android:inputType="textWebEditText"
    android:inputType="textFilter"
    android:inputType="textPhonetic"
//数值类型
    android:inputType="number"
    android:inputType="numberSigned"
    android:inputType="numberDecimal"
    android:inputType="phone"//拨号键盘
    android:inputType="datetime"
    android:inputType="date"//日期键盘
    android:inputType="time"//时间键盘


二、

在布局添加控件手动添加还是拖的添加,添加edittext后布局就不好用,其他控件好用,然后就说下面这段话

Exception raised during rendering: java.lang.System.arraycopy([CI[CII)V

Exception details are logged in Window > Show View > Error Log

 

Check the "Android version to use when rendering layouts" and make sure you‘re not using a version that ends in "W" for Android Wear (e.g. API 20: Android 4.4W). I don‘t believe Wear supports EditText.

bubuko.com,布布扣

修改选择不同的API就好了,降低版本即可

三、

如何显示全部的API(包括低版本的)并且可以下载? 如下:

bubuko.com,布布扣


可以:tools - > options,勾选Force https//.. sources。。。。。。。

bubuko.com,布布扣


【2】安卓学习之控件和布局

原文:http://blog.csdn.net/a1061747415/article/details/41695901

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!