編輯:關於android開發
Frescoj說明:
facebook開源的針對android應用的圖片加載框架,高效和功能齊全。-------------------------------------------Fresco引入包及依賴項↓↓↓↓↓----------------------------------------------
檢查添加mavenCentral();
-------------------------------------------Fresco引入包及依賴項↑↑↑↑↑----------------------------------------------
-------------------------------------------Fresco使用↓↓↓↓↓----------------------------------------------
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:fresco="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.ly.blogtestbutterknife.MainActivity"> <com.facebook.drawee.view.SimpleDraweeView android:id="@+id/my_image_view" android:layout_width="130dp" android:layout_height="130dp" fresco:placeholderImage="@mipmap/ic_launcher" fresco:roundedCornerRadius="5dp" /> </LinearLayout>
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Fresco.initialize(this); setContentView(R.layout.activity_main); Uri uri=Uri.parse("http://b.hiphotos.baidu.com/zhidao/wh%3D450%2C600/sign=6585d7a9820a19d8cb568c0106caaebd/faf2b2119313b07e63bade100ed7912397dd8ca7.jpg"); SimpleDraweeView draweeView= (SimpleDraweeView) findViewById(R.id.my_image_view); DraweeController mDraweeController = Fresco.newDraweeControllerBuilder() .setAutoPlayAnimations(true) //設置uri,加載本地的gif資源 .setUri(uri)//設置uri .build(); //設置Controller draweeView.setController(mDraweeController); }
-------------------------------------------Fresco使用↑↑↑↑↑----------------------------------------------
參考網站:https://www.fresco-cn.org/docs/getting-started.html
Android新手入門2016(11)--非阻塞對話框AlertDialog 寫了這麼久,看了這麼多控件,好像都是靜態的,一點交互都沒有。這次要弄點彈框,活躍活躍。 這次
Android IPC機制(四)用ContentProvider進行進程間通信 ContentProvider為存儲和獲取數據提供統一的接口,它可以在不同的應用程序之間共
活動的生命周期(三):實例上機課,生命周期上機 讓我們再來回顧一下上節課中分享的7個生命周期;分別是:onCreate()、onSar
The Genymotion Virtual device could not obtain an IP address解決辦法,genymotionobtain打開Ge