Fresco的基本使用
来源:互联网 发布:淘宝确认收货是什么 编辑:程序博客网 时间:2024/06/08 07:53
//1:导入依赖
compile 'com.facebook.fresco:fresco:0.11.0'compile 'com.facebook.fresco:animated-gif:0.12.0'
//2:创建MyApplication类继承Application
public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); Fresco.initialize(this); }}
//布局文件activity_main中
<com.facebook.drawee.view.SimpleDraweeView android:layout_width="match_parent" android:layout_height="500dp" android:id="@+id/main_simple_drawee_view" fresco:placeholderImage="@mipmap/ic_launcher"/>
//主函数中调用
public class MainActivity extends AppCompatActivity { private SimpleDraweeView sdv; Button btn; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); sdv = (SimpleDraweeView) findViewById(R.id.main_simple_drawee_view); btn = (Button) findViewById(R.id.btn); Uri uri = Uri.parse("http://dynamic-image.yesky.com/740x-/uploadImages/2015/163/50/690V3VHW0P77.jpg");// sdv.setImageURI(uri); DraweeController controller = Fresco.newDraweeControllerBuilder() .setUri(uri) .setAutoPlayAnimations(true) .build(); sdv.setController(controller); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this,Main2Activity.class); startActivity(intent); } }); }}
阅读全文
0 0
- Fresco的基本使用
- Fresco的基本使用
- Fresco的基本使用
- Fresco图片库的基本使用
- Fresco 框架的基本使用
- Fresco(2)——fresco的基本使用
- 图片加载神器fresco----fresco的基本使用
- 图片框架:Fresco 的基本使用
- Fresco基本使用
- Fresco基本使用
- Fresco 基本使用
- Fresco基本使用基本介绍
- fresco的基本用法
- Fresco的基本使用和各种属性的含义,Fresco加载图片框架
- Fresco的使用
- Fresco的简单使用
- Fresco的使用
- Fresco的初步使用
- 习题3.1
- Sql server提高笔记
- Jquery 1.9.0 以上版本扩展$.browser无法使用的问题
- maven的核心概念
- pods 更新指定库
- Fresco的基本使用
- 02js学习笔记
- sublime text 2 start from command line
- [科学60s]Climate agreement was costing American workers
- Action处理请求,转发回的页面显示空白问题
- 【百度地图API】如何利用自己的数据制作社交地图?只显示可视区域内的标注
- Maven的简介,Maven工程搭建POM,坐标
- Netty源码分析:accept
- Jupyter notebook 安装,初步使用