《Android 基础(三十六)》 Spinner

简介

微调框提供一种方法,让用户可以从值集中快速选择一个值。默认状态下,微调框显示其当前所选的值。 触摸微调框可显示下拉菜单,其中列有所有其他可用值,用户可从中选择一个新值。
spinner

《Android 基础(三十五)》 RecyclerView多类型Item的正确实现姿势

简介

RecyclerView是我们开发过程中经常使用到的一个元素,原生的RecyclerView.Adapter基本上可以满足一般的需求,关于RecyclerView的基础介绍请移步:

RecyclerView基础使用

《Android 基础(三十四)》 TabLayout 从头到脚

简介

1.TabLayout给我们提供的是一排横向的标签页

2.#newTab()这个方法来创建新的标签页,然后用过#setText()和#setIcon方法分别修改标签页的文本和图标,创建完成之后,我们需要使用#addtab()方法把他加到TabLayout中显示出来

3.第二种添加标签的方式就是直接在TabLayout布局下添加#TabItem控件

4.对于TabLayout在标签之前的切换事件我们可以通过注册一个监听器来处理,#setOnTabSelectedListener(OnTabSelectedListener)

5.TabLayout可以和ViewPager一起使用

《Android 基础(三十三)》 TabHost ~ 仿微信底部菜单

简介

Container for a tabbed window view. This object holds two children: a set of tab labels that the
user clicks to select a specific tab, and a FrameLayout object that displays the contents of that
page. The individual elements are typically controlled using this container object, rather than
setting values on the child elements themselves.
TabHost ,标签视图的容器。容器包含两个孩子节点,一个用来存放一系列的标签,点击来选择对应的窗口;一个是FrameLayout用来存放页面具体内容。这些独立的元素通常用TabHost来控制,而不是在视图内部通过设置值来实现

《Android 基础(三十二)》 ViewFlipper

简介

View Flipper,是ViewAnimator的子类,而ViewAnimator又是继承自FrameLayout,而FrameLayout就是平时基本上只显示一个子视图的布局,由于FrameLayout下不好确定子视图的位置,所以很多情况下子视图之前存在相互遮挡,这样就造成了很多时候我们基本上只要求FrameLayout显示一个子视图,然后通过某些控制来实现切换。正好,ViewFlipper帮我们实现了这个工作,我们需要做的就是,选择恰当的时机调用其恰当的方法即可

《Android 基础(二十四)》 EditText

简介

A text field allows the user to type text into your app. It can be either single line or multi-line. Touching a text field places the cursor and automatically displays the keyboard. In addition to typing, text fields allow for a variety of other activities, such as text selection (cut, copy, paste) and data look-up via auto-completion.
You can add a text field to you layout with the EditText object. You should usually do so in your XML layout with a < EditText > element.

《Android 基础(二十二)》 EditText 无法显示完全以及尝鲜Android N

简介

最近将Android Studio更新到了2.2 ,模拟器的Android版本也来到了最新的Nougat。

《Android 基础(二十一)》Android 屏幕适配

基本概念

什么是屏幕尺寸、屏幕分辨率、屏幕像素密度?

屏幕尺寸是指屏幕对角线的长度。单位是英寸,1英寸=2.54厘米

屏幕分辨率是指在横纵向上的像素点数,单位是px,1px=1像素点,一般是纵向像素横向像素,如1280×720

屏幕像素密度是指每英寸上的像素点数,单位是dpi,即“dot per inch”的缩写,像素密度和屏幕尺寸和屏幕分辨率有关

《Android 基础(二十)》 CoordinatorLayout Behavior

介绍

Interaction behavior plugin for child views of {@link CoordinatorLayout}.
A Behavior implements one or more interactions that a user can take on a child view. These interactions may include drags, swipes, flings, or any other gestures.

《Android 基础(十九)》 CoordinatorLayout

介绍

CoordinatorLayout,中文翻译,协调布局,顾名思义,此布局中的子View之间,子View与父布局之间应该是可以协调工作的,如何协调,Behavior。
今天看下Android Studio给我们提供的一个模板Activity

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×