Android development my Sina Weibo client-loading page UI (1.1), androidui

Source: Internet
Author: User

Android development my Sina Weibo client-loading page UI (1.1), androidui

This software sets the user's first access to the page load wait function, which is a waiting page lasting 1 or 2 seconds for the user, while the user is waiting, the program performs some necessary checks and data preparation work. The loading page is divided into the UI and function sections. The first step is the implementation of the UI from the table and in, in addition to functionality, it is also very important for a software to have a glamorous appearance. Although I have a general design level, I have done the following with ps:

<Ignore_js_op> 1. The next task is to display the effect in android, from the design of this effect, the image is divided into four parts: Background, version number, software name and icon, author name, and blog. In this way, four png images are generated, in the Background section, you need to add an additional background image for horizontal screen and vertical screen switching, and then create an android project. My name here is MySinaWeibo. In the android version, check 2.2, create an Activity named MainActivity as the starting page of the entire software, and save the above images to the res/drawable-mdpi folder of the project, for the differences between the drawable-mdpi, drawable-ldpi, and drawable-hdpi folders under the res directory, the mdpi mainly contains medium-resolution images, such as HVGA (320x480 ). Ldpi mainly uses low-resolution images, such as QVGA (240x320 ). Hdpi mainly contains high-resolution images, such as WVGA (480x800) and FWVGA (480x854 ). The android system will go to these folders to find the corresponding images based on the machine resolution. In order to be compatible with different screens of different platforms, we recommend that you store images of different versions in different folders as needed. I will not take this into consideration here. 2. After preparing image resources, write the layout file and create main in the res/layout folder. xml file. This layout uses the LinearLayout control as the top-level control, the image view control is used to align the top of the version number image to the left, align the software name and Icon image to the center, and align the author name and the bottom of the blog image to the right. Note: Add a RelativeLayout control under the version number Image Display ImageView control as the software name and Icon image ImageVIew and author name and the parent control of the blog image ImageView to control the realization that the center alignment has been aligned at the bottom, the specific code is as follows: Copy code 3. Open the Activity source code file MainActivity in ec and edit it. The onCreate code is as follows: copy the code and run the project to display it in the simulator, the above pictures are displayed based on the designed position and effect, but only the background of the entire page is black. The next step is the display of the background part. To achieve the display switching between landscape and landscape screens, the display of the background image uses code to control the display. First, use the following method to obtain whether the current mobile phone is a landscape screen or a portrait screen: copy the code and write a public method named AutoBackground to automatically switch the screen background, this method is required for almost every function page in the following part: copy the code to complete the above two methods, and then call the AutoBackground method in the onCreate method of MainActivity to automatically switch the screen: copy the code
This completes the implementation of the UI part of the load page. The test results in the running simulator are basically consistent with the top design. The test is as follows: <ignore_js_op>
<Ignore_js_op>

Q: customized IT education platform, one-to-one service, Q & A. Official Website for developing programming social headlines: www.wenaaa.com

QQ Group 290551701 has gathered many Internet elites, Technical Directors, architects, and project managers! Open-source technology research, welcome to the industry, Daniel and beginners interested in IT industry personnel!

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.