Original: Http://www.ui.cn/detail/59734.html?utm_source=tuicool
before, I always think of 320pt and 640px, because this can 1x2x perfect fit,
Now that the idea is a little outdated,
iphone 4 iphone 4S iphone 5 iphone 5C iphone 5S are designed with 320pt, now 357pt,414pt come, everyone is holding P6 and p6+ have face.
and Android is generally according to the design of the iOS to adjust the development of appropriate, 640 and 720 difference 80px (40D
In android, how does one set the desired app startup icon to a pop-up box?
First look
This is the effect of clicking on our own apk.
Below is the layout File
VcD4KPHA + YWN0aXZpdHlfbWFpbi54bWzW97K8vtbOxLz + PGJyPgo8L3A + Signature = "http://schemas.android.com/apk/res/android"
Xmlns: tools = "http://schemas.android.com/tools"
The example in this article describes the simple implementation of Android programming to set the activity background to wallpaper. Share to everyone for your reference, specific as follows:
1) Code mode
Drawable wallpaper = Wallpapermanager.getinstance (this). Getdrawable ();
This.getwindow (). setbackgrounddrawable (wallpaper);
2) XML configuration
In the configuration of the activity, add:
This example describes the way Android dynamically adds settings and controls. Share to everyone for your reference, specific as follows:
Sometimes we will be on the code side, dynamically setting, adding layouts and controls. Below we look at how to deal with, directly on the code, the code inside the annotation is very clear.
Layout file: Fragment_hot.xml
Description: This department, I used the ScrollView as the basic layout, mainly to achieve a
It's a real fucking comprehensive solution.1. Describe the lifecycle of an activity.2. If the background activity is recycled by the system for some reason, How can I save the current status before being recycled by the system?3. Set an activity as a window style. (Edited by sodino)4. How to exit the activity? How can I safely exit the application that has called multiple activities?5. Introduce the five la s commonly used in
Recently developed Android app, the program used the toolbar control, want to set the toolbar Navigationicon icon but how to set the icon does not work, always show the control itself.Abnormal:Setting android:navigationicon= "@drawable/icon" in Layout XML or setting in code cannot be customized to Navigationicon pictures that you want to set.The code settings are
A piece of text, if the line spacing is very small, it will be very uncomfortable to look at, we use Word documents when the line spacing is adjustable, then in the Android development process if a large paragraph of long text how to set the line spacing, it is simple to need a line of code:
Android:linespacingextra= "3DP"
Share three pictures:
The first one, without setting the line spacing, uses the sy
Using CSS to set the height and line-height of select is invalid in some versions of Android, but can be added by adding "-webkit-appearance:listbox;" property to resolve the bug, the full instance code is as follows:
. styled-select {
-webkit-appearance:listbox;
width:100%;
font-size:36px;
display:inline-block;
jquery operation Select (value, set selected)
Set the input condition of EditText in Android, androidedittextI. Application scenarios
In the previous shopping mall applications, user data settings were limited as follows:
(1) only English letters, numbers, and @. can be entered in the user's email address,
(2) a user's mobile phone must be allowed to enter only numbers. Do not enter other characters.
(3) The user password should not contain spaces or C
EditText and Autocompletetextview set text selection color most of the Android ROM, text selected background color is very good bright green, but in some garbage Samsung mobile phone, incredibly blue, disgusting, in fact, can be completely through the program to modify , the text's default check background color.
The API used to explain
Copy Code code as follows:
Android:textcolorhighlight
In Android, textview is the most common control used to display text.
In general, the text in textview is a style. How can we set the font, size, color, style, hyperlink, and other attributes for each part of textview text? The following is an example of spannablestring.
Res-layout-main.xml
Res-color-color.xml
Res-color-linkcolor.xml
Textviewlinkactivity
Package COM. snowdream; import Java. io. ioex
In ApiDemo of Android, there is a Button drive effect, but it is still a little different if it is changed to TextView.
Define Marquee, mainly in Project/res/layout/main. xml
[Html]Android: layout_width = "40px"Android: layout_height = "wrap_content"Android: text = "Test marquee for TextView"
Original address (http://www.cnblogs.com/zdz8207/archive/2012/11/27/android-ndk-install.html) Android latest ndk R8 development environment in the window to build installation configuration and use detailed graphic explanation, complete the actual configuration process records (original) I have been trying to develop ndk, but I have been delaying other tasks. I have finally built the environment by referrin
Set up the Android Development Environment (updated to 2015/3) in Win7 and win7android
Build the Android development environment in Win7 (updated to 2015/3)
-- Install and configure JDK + Eclipse + Android SDK + ADT
The establishment of the Android development environment is
two types of screen conversion Animation:
1. TranslateAnimation Effect
2. RotateAnimation effects of screen transfer and Rotation
InResCreate a folderAnimAnd createAnimation. xmlFile:
Encoding = "UTF-8"?>
Xmlns: Android = "http://schemas.android.com/apk/res/android">
Android: fromxdelta = "0"//When the animation is set
Recently I have been studying game development. In games, it is often necessary to set the difficulty of the game. In Android, we can use RatingBar. For details, refer to the following code:
As follows:
Package com.cloay.pt. ui;Import java. io. FileNotFoundException;Import java. io. IOException;Import android. content. ContentResolver;Import
Set the color and font of the control.
Code:
Package com. oyzz. a7_6;
Import Android. App. activity;/* The graphics. Color must be referenced to use the color. * object */Import Android. Graphics. color;Import Android. Graphics. typeface;
Import Android. OS. Bundle;Import
When you set layout parameters for the view in getview of the adapter, use the following method:
Layoutparams Params =NewLayoutparams (layoutparams. fill_parent ,(Int) (Metrics. heightpixels * 0.23f + 0.5f); Convertview. setlayoutparams (Params );
ProgramAn error occurs.
06-08 15:39:43. 071: E/androidruntime (610 ): Java. Lang. classcastexception: Android. View. viewgroup $ layoutparams 06-08 15:39:43.
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.