摘要: 今天很是苦恼,明明设置了android:showAsAction="always",但是所有的items全部都显示在overflow中,然后在官网发现了答案。如果你为了兼容 Android 2.1 的版本使用了 Support 库,在android命名空间下showAsAction属性是不可用的。S... 阅读全文
posted @ 2014-12-26 23:08 iRac 阅读(6843) 评论(0) 推荐(1) 编辑
摘要: EditText继承自TextView,是程序用于和用户进行交互的另一个重要控件,它允许用户在控件里输入和编辑内容,并可以在程序中对这些内容进行处理。使用 android:hint属性来指定了一段提示性的文本,当我们输入任何内容时,这段文本就会自动消失。不过随着输入的内容不断增多,EditText ... 阅读全文
posted @ 2014-12-26 02:44 iRac 阅读(1138) 评论(0) 推荐(1) 编辑
摘要: AutoCompleteTextView自动补全框继承自TextView和EditView,通过一个下拉框的形式可以补全信息。可以通过setThreshold()方法指定用户输入多少个字符后开始显示携带建议信息的下拉框。 设置数据源并添加适配器 1 private void showA... 阅读全文
posted @ 2014-12-26 02:36 iRac 阅读(147) 评论(0) 推荐(0) 编辑
摘要: RatingBar,SeekBar和ProgressBar的子类1 RatingBar事件处理 1 public void showRatingBar() { 2 3 ratingBar = (RatingBar) findViewById(R.id.ratingBar1); 4 ... 阅读全文
posted @ 2014-12-26 02:27 iRac 阅读(156) 评论(0) 推荐(0) 编辑
摘要: SeekBar拖动条,是Progress的间接子类1 SeekBar事件,被拉动时,onProgressChanged会一直被触发 1 public void showSeekBar() { 2 seekBar = (SeekBar) findViewById(R.id.seekBa... 阅读全文
posted @ 2014-12-26 02:16 iRac 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Spinner是个下拉列表框,与listview一样,也是adapterView的一个间接子类,是一个显示数据的窗口。 为Spinner设定数据来源 Mercury Venus Earth Mars Jupiter ... 阅读全文
posted @ 2014-12-26 02:04 iRac 阅读(244) 评论(0) 推荐(0) 编辑