Android 5.0, android5.0

Source: Internet
Author: User

Android 5.0, android5.0

In versions earlier than SDK <21, the ProgressBar can be displayed in front of the button, and is in the middle of the button. However, after switching to android 5.0, the progress bar shows a change in order, and the button is displayed in front, progressBar is behind
My xml configuration file is as follows:


 

<RelativeLayout                  android:layout_width="wrap_content"                  android:layout_height="wrap_content">                   <Button                      android:id="@+id/button_action"                      android:layout_width="match_parent"                      android:layout_height="wrap_content"                      android:text="Login" />                   <ProgressBar                      android:id="@+id/progress_bar"                      android:layout_width="50dp"                      android:layout_height="50dp"                      android:layout_centerInParent="true"/>               </RelativeLayout>

During debugging, you can use the "Show layout bounds display bounds" option in the development option settings to correctly locate the component, but you cannot see anything on the screen during the display.


I am using the Theme. AppCompat style recently released from support. v7.
EDIT:
I also applied the code to set setElevation (0) and setTranslationY (0) for the button, which did not play any role.

Solution

I have been trying to set the translationZ to 0, but I have never thought about setting the translationZ> 0 of ProgressBar,

You only need to set the translationZ attribute of ProgressBar.


Address: http://www.itmmd.com/201412/290.html
This article is organized and published by Meng IT personnel. The reprinted article must indicate the source.

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.