Android Studio extracts the style from the layout file

Source: Internet
Author: User

Write a complex layout file: When quickly finished, found that already fast 1000 lines of code, although there are spaces, but the layout is too large, inadvertently found that the Android studio from the layout file of the method of extracting style, it is very convenient.

First write the view's properties normally in the layout file, then right-click to open the menu, and select Refactor-Extract, Style:

Next, in the Popup Fetch Style dialog box, select the desired property:

Finally, name the style, click OK, and you'll see this style in the Style.xml file:

It's simple to create a style, and the layout file is not so large, saving time and saving energy.

Android Studio extracts the style from the layout file

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.