The use of Android Imgview plugin

Source: Internet
Author: User

In the development we often use the image download function, but we can be on GitHub on some of the more good plug-ins, here is a plug-in called Smartimageview.

Here is its address Https://github.com/loopj/android-smart-image-view

How to use
 PackageXidian.dy.com.chujia;ImportAndroid.os.Bundle;Importandroid.support.v7.app.AppCompatActivity;ImportAndroid.view.View;ImportAndroid.widget.Button;ImportCom.loopj.android.image.SmartImageView; Public classMainactivityextendsappcompatactivity {@Overrideprotected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate);        Setcontentview (R.layout.activity_main); Button btn=(Button) Findviewbyid (R.ID.BTN); if(BTN! =NULL) Btn.setonclicklistener (NewMylister ()); }    classMylisterImplementsview.onclicklistener{@Override Public voidOnClick (View v) {String URL= "Http://192.168.0.109/dog.jpg"; Smartimageview Siv=(Smartimageview) Findviewbyid (r.id.img); if(Siv! =NULL) siv.setimageurl (URL); }    }}

Layout file

<?XML version= "1.0" encoding= "Utf-8"?><LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Xmlns:tools= "Http://schemas.android.com/tools"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "vertical"Tools:context= "Xidian.dy.com.chujia.MainActivity">        <ButtonAndroid:id= "@+id/btn"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:text= "@string/delete"           />        <Com.loopj.android.image.SmartImageViewAndroid:id= "@+id/img"Android:layout_width= "100DP"Android:layout_height= "100DP"android:src= "@drawable/dog1"            /></LinearLayout>

This can be compared with your own hand-written picture loading.

Http://www.cnblogs.com/xidongyu/p/5612545.html

The use of Android Imgview plugin

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.