Show a view in a different background?

I want to show a progress bar on the background of viewing the image, is this possible? Please, help?

+4
source share
3 answers
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background" android:drawable="@drawable/custom_background1" /> <item android:id="@android:id/secondaryProgress"> <clip android:drawable="@drawable/custom_background2" /> </item> <item android:id="@android:id/progress"> <clip android:drawable="@drawable/custom_background3" /> </item> </layer-list> 

create an xml file in drawalbe as above and in layout.xml using

 android:progressDrawable="@drawable/music_volume_seekbar_style" 

Do you mean this?

+1
source

For any views, this is not possible. But if you have an ImageView , you can use the ImageView.setAlpha(int) method.

0
source

Well, you can overlay two views (ImageView and progress bar). Set ImageView to VISIBLE and your progress bar to have default GONE visibility.

If you want, you can make your progress indicator visible. Note that you need to set the background of your ProgressBar transparent.

Read more about how to make the background look transparent here: http://www.41post.com/4213/programming/android-transparent-or-translucent-view-background

0
source

Source: https://habr.com/ru/post/1391791/


All Articles