Android calculator Layout

Source: Internet
Author: User

Introduction:

After learning several android layout methods, we made an android calculator.

I searched the internet for this information and found that there was a problem with the layout, not full of the screen, but only accounted for a part.

The instructor's suggestion is: Setting the font size is the key. However, after I fixed the font size problem and solved the screen problem, I found that the font was not centered. On the left side of the horizontal line. The attribute used later has not changed. But later I found that this attribute does not appear to be used, and a Layout is used for nesting to solve this problem.

The implementation result is as follows:


 

 

 

 

 

 

 

 

 

 

The xml file code in LayOut is as follows:

View Code
25sp45dp

Note: If the whole screen is not fully covered during copying, change

The two parameters to be added to the dimens file.

Copy the Translation results to Google

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.