undoubtedly possible, but it is not universal... The following is an example:
Let's first implement the process of setting the height of the ImageView to make the image display a normal proportion in this specific simulator:
The actual pixel size of the above image is: 828*314, the ratio of width to height is about 2.43, and the size of the simulator we use here is 480*800 (unit: px, that is, pixels), that is to say, the width of the pixel is 480, so we need to set the height of this ImageVie
Many times, the use of touch screen fling, scroll, such as gesture (gesture) operation will make the user experience of the application greatly increased, such as using scroll gestures in the browser to roll the screen, with the Fling in the reader page and so on. In Android, gesture recognition is done through the Gesturedetector.ongesturelistener interface, but
resolution. 2, consider the horizontal screen and vertical screen layout effect: Android has Layout-port and layout-land two directories placed vertical screen and horizontal screen of two layout files, the mobile phone screen
The screen sizes of Android devices are various, but they can be divided into two major parts during design: versions earlier than 3.0 and Versions later than 3.0. What problems will this cause? Let's use three assumptions to explain.1. Assume that you have two 4 inch devices on your hand. The resolution of device A is 800 × 480, and that of Device B is 1600 × 960. You have designed A 64*64 pixel icon on de
A few days ago, I received a request from the customer to create an Android mobile phone and screen saver on the Panel. In fact, it is quite strange that screen saver is used for computers, but when the phone is not used, is it OK to turn off the screen? It is said that the current smart phone battery is not durable an
When the screen rotates and switches, the Android mechanism is:Destroy the current screen activity, and then reopen a new activity that adapts to screen changes.So how do we get the page information not reset when the screen is switched?
Solution implementation:1. In the An
Objective:Project is based on the development of the tablet, the design of the interface is to require a horizontal screen display interface. So I've forced all the activity to be set to horizontal screenandroid:screenorientation="landscape"-----------------------------------------------------------------------------------------------------Problem:The main interface, the most common activity+n a fragmentI u
=================================== displaymetrics (222) (8509): screenWidthDip=320; screenheightdip=533
e/== myscreenactivity =================================== displaymetrics (222) (8509): screenWidth=480; screenheight=800
Analysis Results:
In the OnDraw () method
Methods 1 and 2, the results are consistent, are 320*533, is obviously not the test machine i9000 screen size
Method 3, will be the results of methods 1 and 2, multiplied by densi
The screen length obtained in android is longer than the width. According to the code on the Internet, the result is inconsistent with the actual value. For example, if my mobile phone is i9000 and the screen size is 480 * 800px, the result is 320*533.The results were unreliable, so I wrote a few lines of code to test it.Test parameters:Test environment: i9000 (S
In android, image adaptation is a tricky task. This article details the principle of screen display, why does it exist in resource files?
Drawable-ldpi, drawable-mdpi, drawable-hdpi, drawable-xhdpi, and other folders. Why do we use dp as the unit.
Start with the display effect of the two images.
The system will generate drawable-ldpi, drawable-mdpi, drawable-hdpi,
Drawable-xhdpi and drawable-xxhdpi. For th
Recently, Android Camera-related programs have been developed to maximize screen rotation. On the one hand, we must consider the layout changes after screen rotation, on the other hand, we need to figure out the relationship between the orientation and angle of the screen and the Preview angle of Camera. Originally, th
modeAndroid:theme= "@android: Style/theme.notitlebar" does not display the application title barAndroid:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and full screenAndroid:theme= "Theme.light" background is whiteAndroid:theme= "Theme.Light.NoTitleBar" white background with no title barAndroid:theme= "Theme.Light.NoTitleBar.Fullscreen" white background, no
obviously not the size of the i9000 screen of the test machine.
Method 3: multiply the results obtained from methods 1 and 2 by the density, and then the perfect 480*800, perfect!
Note:If the density is greater than 1, you must set the targetSdkVersion to 4-9. For example:
However, does this mean that method 3 must be generic?
The answer is no, because I also tested it on the simulator, HTC G14 physical machine, ViewSonic, and Galaxy
modeAndroid:theme= "@android: Style/theme.notitlebar" does not display the application title barAndroid:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and full screenAndroid:theme= "Theme.light" background is whiteAndroid:theme= "Theme.Light.NoTitleBar" white background with no title barAndroid:theme= "Theme.Light.NoTitleBar.Fullscreen" white background, no
The Qt for Android program disables screen rotation. qtandroid
Sometimes we want to keep the interface of a program in one direction and not change with the orientation of the mobile phone (tablet): Add in every Activity configuration in AndroidManifest. xml that needs to be switched off
android:screenOrientation=”landscape”
Attribute.
Landscape = landscape
Portr
(Window.feature_no_title);
Attached:Android system comes with styleAndroid:theme= "@android: Style/theme.dialog" displays an activity as a dialog box modeAndroid:theme= "@android: Style/theme.notitlebar" does not display the application title barAndroid:theme= "@android: Style/theme.notitlebar.fullscreen" does not display the application title bar and full
Android Screen Switch
Android controls the direction of activity, as long as you add a sentence to the corresponding activity node in the Androidmanifest.xml
android:screenorientation= "Landscape" (landscape is horizontal screen, portrait vertical screen).
I have mixed wi
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.