Android progress bar Changes image transparency

Source: Internet
Author: User

1 <?XML version= "1.0" encoding= "Utf-8"?>2 <LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"3 Xmlns:tools= "Http://schemas.android.com/tools"4 Android:layout_width= "Match_parent"5 Android:layout_height= "Match_parent"6 Tools:context= "Com.example.administrator.jsq.MainActivity"7 android:orientation= "vertical">8     <!--Picture Transparency -9     <SeekBarTen         Android:layout_width= "Match_parent" One Android:layout_height= "Wrap_content" A Android:max= "+" - android:progress= "0" - Android:id= "@+id/sar"/> the     <ImageView -         Android:layout_width= "Wrap_content" - Android:layout_height= "Wrap_content" - android:src= "@drawable/f8" + Android:id= "@+id/tp" -         /> + </LinearLayout>
1  Packagecom.example.administrator.jsq;2 3 ImportAndroid.media.Image;4 Importandroid.support.v7.app.AppCompatActivity;5 ImportAndroid.os.Bundle;6 ImportAndroid.util.Log;7 ImportAndroid.view.View;8 ImportAndroid.widget.ImageView;9 ImportAndroid.widget.SeekBar;Ten  One  Public classMainactivityextendsappcompatactivity { A SeekBar SAR; - ImageView tp; -  the @Override -     protected voidonCreate (Bundle savedinstancestate) { -         Super. OnCreate (savedinstancestate); - Setcontentview (r.layout.activity_main); +SAR =(SeekBar) Findviewbyid (R.id.sar); -TP =(ImageView) Findviewbyid (R.ID.TP); +Tp.setimagealpha (0); ASar.setonseekbarchangelistener (NewSeekbar.onseekbarchangelistener () { at @Override -              Public voidOnprogresschanged (SeekBar SeekBar,intProgressBooleanFromuser) { - Tp.setimagealpha (progress); -             } -  - @Override in              Public voidOnstarttrackingtouch (SeekBar SeekBar) { -LOG.E ("TAG", "progress bar start dragging"); to             } +  - @Override the              Public voidOnstoptrackingtouch (SeekBar SeekBar) { *LOG.E ("TAG", "Progress bar Stop dragging"); $             }Panax Notoginseng         }); -     } the}
1 <?XML version= "1.0" encoding= "Utf-8"?>2 <Manifestxmlns:android= "Http://schemas.android.com/apk/res/android"3  Package= "COM.EXAMPLE.ADMINISTRATOR.JSQ">4 5     <Application6         Android:allowbackup= "true"7 Android:icon= "@mipmap/ic_launcher"8 Android:label= "@string/app_name"9 Android:supportsrtl= "true"Ten Android:theme= "@style/apptheme"> One         <ActivityAndroid:name=". Mainactivity "> A             <Intent-filter> -                 <ActionAndroid:name= "Android.intent.action.MAIN" /> -                 <categoryAndroid:name= "Android.intent.category.LAUNCHER" /> the             </Intent-filter> -         </Activity> -     </Application> -  + </Manifest>

But no matter how the change always prompts the error message ↓

Android progress bar Changes image transparency

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.