This series is the "first line of Android Code" Learning notes, if there are errors and omissions, please correct me!View is one of the most basic UI components on Android that can draw a rectangular area on the screen and respond to various events in this area, so the various controls we use actually add their own functionality to the view base. ViewGroup is a special view that can contain many sub-view and sub-viewgroup, and is a container for placing controls and
is usedSmall black: Framelayout The following is directly textview, compared with the previous one less layer relativelayout and achieve the same effect.At some point, you define reusable layouts that include too many levels of labels, for example, weFor example: such words. Use Small white: What is the case for using the merge tag?Small black: One is the same as the example above. The child view does not need to specify any layout properties for the
Previous wordsThe two-column layout of the 6 ideas for a single-column, fixed-width single-row adaptive layout in the CSS two column layout has been described earlier, while the two-row adaptive layout refers to the layout of a column that is stretched by content and the remaining width is covered by another column. This article introduces 4 ideas for two-column adaptive layouts from float, table, Flex, and gridfloat" idea one"float In a single-row, f
Layouts are used to define how the container organizes inner child elements and controls the size of child elements.There are two types of layouts in ExtJS: The Container container class layout and the component component Class layout.Containter Container Class layout: Responsible for container content ExtJS elements and resizing extjs elements.Includes: Border layout, box layout, fit layout, and more.Com
First, overview:In everyday app use, we see the hot tags in android apps and the streaming layouts, and today we're going to look at how toCustomize a streaming layout that looks like a popular tag (source download is given at the bottom)Similar custom layouts. Here we will detail the application features of streaming layouts and the technical points used:1. The
controls in a tabular manner, which is not very commonly used.Modify the layout file code as follows:Each addition to a tablerow in the tablelayout means that a column is added to the table, and then each time a control is added to the TableRow, a column is added to the row, and thecontrol in the TableRow cannot specify a width. Android:inputtype= the "Textpassword" property to change the input box to the password input boxThe android:layout_span= "2" property indicates that the control occupie
ExtJS's container component can be set to its display style, its valid values are absolute, accordion, anchor, border, card, column, fit, form and table. Altogether 9 kinds.Several other see: Http://www.sencha.com/deploy/dev/examples/layout-browser/layout-browser.html inside there are detailed examples.· Absolute, as the name implies, locates the display inside the container according to the specified coordinates.This was a simple layout style that allows position items within a container using
Contentoffsetadjustment and Contentsizeadjustment properties.Cocoachina is the world's largest Apple development Chinese community, the official daily time to push a variety of exciting research and development resources and tools, the introduction of app marketing experience, the latest corporate recruitment and outsourcing information, as well as the cocos2d engine, Cocos Studio Development Kit, the latest news and training information. Attention can be the first time to understand the latest
|");
Btn3.setid (3);
Relativelayout.layoutparams lp3 = new Relativelayout.layoutparams (ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
Lp3.addrule (Relativelayout.below, 1);
Lp3.addrule (relativelayout.right_of, 2);
Lp3.addrule (Relativelayout.align_right, 1);
//BTN3 is located below the btn1, right side of the BTN2, and aligned with BTN1 's right (to expand)
Rl.addview (BTN3,LP3);
Button BTN4 = New button (this);
Btn4.settext ("---------
the elements equal width.Next, we add a horizontal spacing constraint for the delete and Cancel buttons, select the Horizontal spacing constraint, modify its constant-bit standard, and modify the relation to greater Than or Equal:In this way, the button looks like the layout shown:As you can see, the buttons in the horizontal mode, look good, but in the vertical mode although there is no overlap, but the last button is not complete the whole word of reality.We can prioritize constraints, with a
; so 3:1:1 Billy shows. Then you will understand why when you set three Layout_weight to 1, 2, and 3, the following effect appears:The third one directly does not show, why? Let's take a look at the above method to calculate it: The system first assigns 3 TextView the width fill_parent they want, which means that each one fills his parent control, and here the width of the dead screen so this time the remaining space = 1 parent_width-3 parent_width=-2 a parent_width (parent_ Width refers to scr
control, preferably not. android:layout_weight= "1" represents the layout weight with the sibling control, if two are 1 that is one half, the number of large occupy more space -Relativelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Xmlns:tools= "Http://schemas.android.com/tools"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"Tools:context=". Mainactivity "> LinearLayoutandroid:orientation= "vertical"Android:layout_width= "Match_parent"Androi
1) fill_parentSetting the layout of a component to fill_parent will force the component to expand to fill as much space as possible within the layout unit. This is roughly the same as the DockStyle property of Windows controls. Setting a top layout or control for Fill_parent will force it to fill the entire screen.2) wrap_contentSetting the size of a view to Wrap_content will force the view to expand to show the entire content. Take the TextView and ImageView controls as an example, set to Wrap_
, and then set the negative margins in the. Sub and. Extra to display the contents of the middle .}#bd {padding:0 190px 0 190px; //Set the padding in . BD, and then set the negative margins in the. Sub and. Extra to display the contents of the middle .Background-color: #ff0;Overflow:hidden; Settings beyond content hiding, etc.}#ft {width:100%;height:100px;Background-color: #5880F4;}EffectWhat to look at---------------------------------------------dividing line----------------------------------
Responsive and adaptive principles are similar, are detection devices, depending on the device with different CSS, and the CSS is used as a percentage, rather than a fixed width.The difference is that the responsive template looks different on the device and changes the presentation style as the device changes.And adaptive does not, all devices appear to be a set of templates, but the length or image is smaller, not according to the device with different display style.Flow is the use of some set
= (Button) Layout.findviewbyid (R.ID.BTN);
Btn.setbackgroundcolor (Color.cyan);
//Display
Setcontentview (layout);
}
}
In addition, Getsystemservice is a method in activity that obtains the corresponding service object based on the name passed in, and these service name parameters are constants in the context class:Description of the object returned by the incoming nameWindow_service WindowManager managing open Windows programsLayout_inflater_service Layoutinflater Gets the view def
the size of the container according to the screen resolution, the position of each container is proportional, the relative position will not change;Responsive layout: The container element adjusts the position according to the screen resolution, the size of each container according to different screen resolution according to different proportions distribution;Static layout: The size and position of the container element is fixed.More Professional Description: http://blog.csdn.net/iefreer/articl
This example and the preceding LinearLayout Android ApiDemos example resolution (145): Views-> Layouts-> LinearLayout-> 5. simple Form implements the same function to construct an input Form, but this example uses the RelativeLayout layout. During actual development, you can decide which layout to use.
Android: layout_width = "match_parent"Android: layout_height = "wrap_content"Android: background = "@ drawable/blue"Android: padding = "10dip">
TextVie
size. Inline elements are different, and by default the contents of the mid-term are arranged, and their shapes are displayed. Another block element adds a newline between the front and the back, which means that the block element is displayed by default (unless we set a float or use a displacement to change its initial position), and through the display property, we can set the state of the element to be displayed;Display:block; /* element is displayed as a block element */ Display:block; /* e
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.