首页 > 其他 > 详细

SmartImageView-网络图片查看器

时间:2015-10-25 17:55:06      阅读:182      评论:0      收藏:0      [点我收藏+]

在gitHub.com里下载SmarImage

xml文件:

<com.loopJ.android.image.SmartImageView

        android:layout_weight="1000"

        android:id="@+id/siv"

        android:layout_width="fill_parent"

        android:layout_height="fill_parent"/>

<EditText

    android:singleLine="true"

    android:id="@+id/et+path"

    android:layout_width="fill_parent"

    android:layout_height="wrap_content"

    android:hint="请输入图片路径"/>

<Button

    android:onClick="click"

    android:layout_width="fill_parent"

    android:layout_height="wrap_content"

    android:text="浏览"/>   

 

MainActivity文件:

public void click(View view){

    SmartImageView siv = (SmartImageView) findViewById(R.id.siv);

    //第二个参数表示下载失败的时候显示的图片,第三个参数表示图片还在加载的时候显示

    siv.setImageUrl(et_path.getText().toString().trim(),

        R.drawable.ic_launcher, R.drawable.ic_launcher);

}

SmartImageView-网络图片查看器

原文:http://www.cnblogs.com/changyinlu/p/4909058.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!