file (DTD recommendations on the application node):Java code1.2. Android:anydensity= "true"3. Android:largescreens= "true"4. Android:normalscreens= "true"5. Android:smallscreens= "true"6. Android:resizeable= "true"/>View and ViewGroupView and ViewGroupThe UI interface for Android is made up of a combination of view and ViewGroup and their derived classes.Where view is the base class for all UI components,
Android easily implements pull-down refresh of imitation QQ space, and android easily implements
(This article describes the process of implementing the dynamic effect of list drop-down refresh in Android. The source code is included at the end of this Article .)After reading this article, you can learn:
1. Implementation principle of pull-down refresh
2. Custom
Android custom ViewPager (1) -- custom Scroller to simulate the animation process
I believe that the ViewPager component provided by the Android SDK is quite familiar to everyone, but ViewPager exists in support. in the v4 package, ViewPager does not exist in earlier android versions. How can we use sliding effects similar to ViewPager in earlier
, there is no see Mscroller = new Scroller (context) This line of code, We need to use this mscroller to do this Swipeitemview slide animation effect. We know that the Scrollby () and Scrollto () Two methods are available in ViewGroup to move this viewgroup view content, where Scrollby () moves the distance specified by the parameter, and the Scrollto () method moves to the location specified by the paramet
I. Introduction
A. Functions and usage of the gridview (network view)
B. Functions and usage of imageswitcher
C. Functions and usage of Gallery (GALLERY view)
2. Use an instance to learn Gallery, gridview, and imageswitcher
Step 1: Create a project named mygridviewandgallery.
3. Use gridview and imageswitcher to implement them first.
Step 1: Design the UI
A./layout/gridview. xml
B. UI/layout/cell. xml of each cell
Step 2: mygridviewactivity. Java
Package CN. roco. gridview; impor
process for the entire viewgroup is:Dispatchevent->onintercepttouchevent->child.dispatchevent-> (setontouchlistener->ontouchevent)The above summary is based on: if not intercepted, then how to intercept it?OnintercepttoucheventpublicbooleanonInterceptTouchEvent(MotionEvent ev) { returnfalse; The code is very simple, only one sentence, that is, return False,viewgroup by default is not intercepted. If
, you will know how to write it when you write more.
The following is the complete code for the custom pull-down refresh control:
Package com. sdufe. thea. guo. view; import java. text. simpleDateFormat; import java. util. date; import android. content. context; import android. util. attributeSet; import android. view. layoutInflater; import
Onfinishinflate () is triggered when all the child controls in the view are mapped to XML
Onmeasure (INT, INT) determines the size of all child elements
Onlayout (Boolean, Int, INT) is triggered when the view allocates the size and position of all
ScrollView Nested ListView Event Distribution problem (disallowintercept in hidden)#转载请注明出处, thank you. A few days ago friends asked ScrollView nested listview, sliding events only in the Scrollview,listview internal can not slide, although he found
example, move), the event will be turned into a cancel event and passed to the child view that previously handled the gesture (gesture). The Ontouchevent method for ViewGroup is no longer passed (whether it is an intercepted move or a system-generated cancel). Only the events that come again will be passed to the ViewGroup ontouchevent method.
From now on, you can go further:
For example, ove
In Android, any control can be scrolled because there are scrollto () and Scrollby () methods in the view class, as shown in the following illustration:
The primary role of the two methods is to move the view/viewgroup to the specified coordinates and save the offset. Other than that:
Mscrollx represents the offset coordinates of the x-axis directionmscrolly represents the offset coordinates of the Y ax
WebView for Android and webview for androidPlease indicate the source of http://blog.csdn.net/typename/ powered by miechal zhao: miechalzhao@gmail.com:
According to the market share of various Android systems (Google Android dashboards) announced by Google, Android 4.0 and above are about 90%, and the development trend
In Android, view controls are roughly divided into two categories, the ViewGroup and View,viewgroup controls as the parent control, containing and managing the child view, and forming the control tree through ViewGroup and view. Individual Viewgoup objects and view objects are nodes in the control tree. In the control
Source code analysis of the View rendering mechanism in Android
I haven't written a blog for almost half a year. I think my work is busy, I think there is nothing worth writing, and I think I am getting lazy, however, I recently have some new ideas about the View rendering mechanism in Android, so I want to record it and share it with you. In the following blogs, I will share the following content:
1. Anal
. motionEvent; import android. view. view; import android. view. viewGroup; import android. widget. scroller; import android. widget. toast;/*** Scroller principle: * to move the content of a View or ViewGroup, we often use scroll
Android: descendantFocusability usage analysis,
A common problem in development is that the listview in a project is not just a simple text, but you often need to define your own listview, and your own Adapter will inherit the BaseAdapter and write it as needed, the problem may occur. When you click an item, the system does not respond and cannot obtain the focus. Most of the reasons are that sub-controls such as ImageButton, Button, and CheckBox exis
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.