最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android實(shí)現(xiàn)圖片九宮格

 更新時(shí)間:2022年06月28日 14:40:44   作者:hishere  
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)圖片九宮格,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了Android實(shí)現(xiàn)圖片九宮格的具體代碼,供大家參考,具體內(nèi)容如下

九宮格分三類

實(shí)現(xiàn)的效果

具體實(shí)現(xiàn)

activity_main

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
? ? xmlns:app="http://schemas.android.com/apk/res-auto"
? ? xmlns:tools="http://schemas.android.com/tools">

? ?<data>

? ?</data>
? ? <androidx.constraintlayout.widget.ConstraintLayout
? ? ? ? android:layout_width="match_parent"
? ? ? ? android:layout_height="match_parent">

? ? ? ? <androidx.recyclerview.widget.RecyclerView
? ? ? ? ? ? android:id="@+id/recyclerView"
? ? ? ? ? ? android:layout_width="match_parent"
? ? ? ? ? ? android:layout_height="match_parent"
? ? ? ? ? ? app:layout_constraintBottom_toBottomOf="parent"
? ? ? ? ? ? app:layout_constraintEnd_toEndOf="parent"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="parent"
? ? ? ? ? ? app:layout_constraintTop_toTopOf="parent" />
? ? </androidx.constraintlayout.widget.ConstraintLayout>
</layout>

item_main

<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:android="http://schemas.android.com/apk/res/android"
? ? xmlns:app="http://schemas.android.com/apk/res-auto">

? ? <data>
? ? ? ? <variable
? ? ? ? ? ? name="img"
? ? ? ? ? ? type="com.nooneb.ninegrid.Img" />
? ? ? ? <import type="android.view.View"/>
? ? </data>

? ? <androidx.constraintlayout.widget.ConstraintLayout
? ? ? ? android:layout_width="match_parent"
? ? ? ? android:layout_height="wrap_content"
? ? ? ? android:padding="64dp">

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/oneImg"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isOne()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="1:1"
? ? ? ? ? ? app:layout_constraintEnd_toEndOf="parent"
? ? ? ? ? ? app:layout_constraintHorizontal_bias="0.0"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="parent"
? ? ? ? ? ? app:layout_constraintTop_toTopOf="parent"
? ? ? ? ? ? app:localImg="@{img.img1}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/twoImg1"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isTwoOrFour()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="w,1:1"
? ? ? ? ? ? app:layout_constraintEnd_toStartOf="@+id/guideline2"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="parent"
? ? ? ? ? ? app:layout_constraintTop_toTopOf="parent"
? ? ? ? ? ? app:localImg="@{img.img1}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/twoImg2"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isTwoOrFour()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="1:1"
? ? ? ? ? ? app:layout_constraintEnd_toEndOf="parent"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="@+id/guideline2"
? ? ? ? ? ? app:layout_constraintTop_toTopOf="parent"
? ? ? ? ? ? app:localImg="@{img.img2}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/twoImg3"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isFour()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="w,1:1"
? ? ? ? ? ? app:layout_constraintEnd_toStartOf="@+id/guideline2"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="parent"
? ? ? ? ? ? app:layout_constraintTop_toBottomOf="@+id/twoImg1"
? ? ? ? ? ? app:localImg="@{img.img3}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/twoImg4"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isFour()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="1:1"
? ? ? ? ? ? app:layout_constraintEnd_toEndOf="parent"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="@+id/guideline2"
? ? ? ? ? ? app:layout_constraintTop_toBottomOf="@+id/twoImg2"
? ? ? ? ? ? app:localImg="@{img.img4}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/threeImg1"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isOther()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="w,1:1"
? ? ? ? ? ? app:layout_constraintEnd_toStartOf="@+id/guideline3"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="parent"
? ? ? ? ? ? app:layout_constraintTop_toTopOf="parent"
? ? ? ? ? ? app:localImg="@{img.img1}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/threeImg2"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isOther()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="1:1"
? ? ? ? ? ? app:layout_constraintEnd_toStartOf="@+id/guideline4"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="@+id/guideline3"
? ? ? ? ? ? app:layout_constraintTop_toTopOf="parent"
? ? ? ? ? ? app:localImg="@{img.img2}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/threeImg3"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isOther()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="1:1"
? ? ? ? ? ? app:layout_constraintEnd_toEndOf="parent"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="@+id/guideline4"
? ? ? ? ? ? app:layout_constraintTop_toTopOf="parent"
? ? ? ? ? ? app:localImg="@{img.img3}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/threeImg4"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isOther()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="1:1"
? ? ? ? ? ? app:layout_constraintEnd_toStartOf="@+id/guideline3"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="parent"
? ? ? ? ? ? app:layout_constraintTop_toBottomOf="@+id/threeImg1"
? ? ? ? ? ? app:localImg="@{img.img4}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/threeImg5"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isOther()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="1:1"
? ? ? ? ? ? app:layout_constraintEnd_toStartOf="@+id/guideline4"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="@+id/guideline3"
? ? ? ? ? ? app:layout_constraintTop_toBottomOf="@+id/threeImg2"
? ? ? ? ? ? app:localImg="@{img.img5}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/threeImg7"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isOther()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="1:1"
? ? ? ? ? ? app:layout_constraintEnd_toStartOf="@+id/guideline3"
? ? ? ? ? ? app:layout_constraintHorizontal_bias="0.0"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="parent"
? ? ? ? ? ? app:layout_constraintTop_toBottomOf="@+id/threeImg4"
? ? ? ? ? ? app:localImg="@{img.img7}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/threeImg8"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isOther()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="1:1"
? ? ? ? ? ? app:layout_constraintEnd_toStartOf="@+id/guideline4"
? ? ? ? ? ? app:layout_constraintHorizontal_bias="0.0"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="@+id/guideline3"
? ? ? ? ? ? app:layout_constraintTop_toBottomOf="@+id/threeImg5"
? ? ? ? ? ? app:localImg="@{img.img8}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/threeImg6"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isOther()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="1:1"
? ? ? ? ? ? app:layout_constraintEnd_toEndOf="parent"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="@+id/guideline4"
? ? ? ? ? ? app:layout_constraintTop_toBottomOf="@+id/threeImg3"
? ? ? ? ? ? app:localImg="@{img.img6}" />

? ? ? ? <ImageView
? ? ? ? ? ? android:id="@+id/threeImg9"
? ? ? ? ? ? android:layout_width="0dp"
? ? ? ? ? ? android:layout_height="0dp"
? ? ? ? ? ? android:visibility="@{img.isOther()?View.VISIBLE:View.GONE}"
? ? ? ? ? ? app:layout_constraintDimensionRatio="1:1"
? ? ? ? ? ? app:layout_constraintEnd_toEndOf="parent"
? ? ? ? ? ? app:layout_constraintHorizontal_bias="0.0"
? ? ? ? ? ? app:layout_constraintStart_toStartOf="@+id/guideline4"
? ? ? ? ? ? app:layout_constraintTop_toBottomOf="@+id/threeImg6"
? ? ? ? ? ? app:localImg="@{img.img9}" />

? ? ? ? <androidx.constraintlayout.widget.Guideline
? ? ? ? ? ? android:id="@+id/guideline2"
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:orientation="vertical"
? ? ? ? ? ? app:layout_constraintGuide_percent=".5" />

? ? ? ? <androidx.constraintlayout.widget.Guideline
? ? ? ? ? ? android:id="@+id/guideline3"
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:orientation="vertical"
? ? ? ? ? ? app:layout_constraintGuide_percent=".333333" />

? ? ? ? <androidx.constraintlayout.widget.Guideline
? ? ? ? ? ? android:id="@+id/guideline4"
? ? ? ? ? ? android:layout_width="wrap_content"
? ? ? ? ? ? android:layout_height="wrap_content"
? ? ? ? ? ? android:orientation="vertical"
? ? ? ? ? ? app:layout_constraintGuide_percent=".666666" />

? ? </androidx.constraintlayout.widget.ConstraintLayout>
</layout>

實(shí)體類

public class Img {
? ? public Integer img1;
? ? public Integer img2;
? ? public Integer img3;
? ? public Integer img4;
? ? public Integer img5;
? ? public Integer img6;
? ? public Integer img7;
? ? public Integer img8;
? ? public Integer img9;

? ? public Img(Integer img1, Integer img2, Integer img3, Integer img4, Integer img5, Integer img6, Integer img7, Integer img8, Integer img9) {
? ? ? ? this.img1 = img1;
? ? ? ? this.img2 = img2;
? ? ? ? this.img3 = img3;
? ? ? ? this.img4 = img4;
? ? ? ? this.img5 = img5;
? ? ? ? this.img6 = img6;
? ? ? ? this.img7 = img7;
? ? ? ? this.img8 = img8;
? ? ? ? this.img9 = img9;
? ? }

? ? public int count(){
? ? ? ? int i=0;
? ? ? ? if (img1!=null)i++;
? ? ? ? if (img2!=null)i++;
? ? ? ? if (img3!=null)i++;
? ? ? ? if (img4!=null)i++;
? ? ? ? if (img5!=null)i++;
? ? ? ? if (img6!=null)i++;
? ? ? ? if (img7!=null)i++;
? ? ? ? if (img8!=null)i++;
? ? ? ? if (img9!=null)i++;
? ? ? ? return i;
? ? }
? ? public boolean isOne(){
? ? ? ? return count()==1;
? ? }
? ? public boolean isTwoOrFour(){
? ? ? ? return count()==2||count()==4;
? ? }
? ? public boolean isFour(){
? ? ? ? return count()==4;
? ? }
? ? public boolean isOther(){
? ? ? ? if (count()!=1){
? ? ? ? ? ? if (count()!=2){
? ? ? ? ? ? ? ? return count() != 4;
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? return false;
? ? }
}

圖片適配器

public class ImgAdapter {
? ? @BindingAdapter("localImg")
? ? public static void set(ImageView imageView,Integer res){
? ? ? ? if (res==null){
? ? ? ? ? ? imageView.setVisibility(View.GONE);
? ? ? ? ? ? return;
? ? ? ? }
? ? ? ? imageView.setImageResource(res);

? ? }
}

列表適配器

public class MyAdapter extends RecyclerView.Adapter<MyAdapter.Holder> {

? ? private final Context context;
? ? public List<Img> imgs;

? ? public MyAdapter(Context context,List<Img> imgs) {
? ? ? ? this.context = context;
? ? ? ? this.imgs=imgs;
? ? }

? ? @NonNull
? ? @Override
? ? public Holder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
? ? ? ? ItemImgBinding binding = ItemImgBinding.inflate(
? ? ? ? ? ? ? ? LayoutInflater.from(context),
? ? ? ? ? ? ? ? parent,
? ? ? ? ? ? ? ? false);
? ? ? ? return new Holder(binding);
? ? }

? ? @Override
? ? public void onBindViewHolder(@NonNull Holder holder, int position) {
? ? ? ? Img img = imgs.get(position);
? ? ? ? holder.binding.setImg(img);
? ? ? ? holder.binding.executePendingBindings();
? ? }

? ? @Override
? ? public int getItemViewType(int position) {
? ? ? ? return position;
? ? }

? ? @Override
? ? public int getItemCount() {
? ? ? ? return imgs.size();
? ? }

? ? public class Holder extends RecyclerView.ViewHolder {
? ? ? ? ItemImgBinding binding;
? ? ? ? public Holder(ItemImgBinding binding) {
? ? ? ? ? ? super(binding.getRoot());
? ? ? ? ? ? this.binding=binding;
? ? ? ? }
? ? }
}

MainActivity

public class MainActivity extends AppCompatActivity {

? ? ActivityMainBinding binding;
? ? MyAdapter myAdapter;

? ? @Override
? ? protected void onCreate(Bundle savedInstanceState) {
? ? ? ? super.onCreate(savedInstanceState);
? ? ? ? binding = ActivityMainBinding.inflate(getLayoutInflater());
? ? ? ? setContentView(binding.getRoot());

? ? ? ? List<Img> imgs = Arrays.asList(
? ? ? ? ? ? ? ? new Img(R.drawable.avatar_1, null, null, null, null, null, null, null, null),
? ? ? ? ? ? ? ? new Img(R.drawable.avatar_1, R.drawable.avatar_2, null, null, null, null, null, null, null),
? ? ? ? ? ? ? ? new Img(R.drawable.avatar_1, R.drawable.avatar_2, R.drawable.avatar_3, null, null, null, null, null, null),
? ? ? ? ? ? ? ? new Img(R.drawable.avatar_1, R.drawable.avatar_2, R.drawable.avatar_3, R.drawable.avatar_4, null, null, null, null, null),
? ? ? ? ? ? ? ? new Img(R.drawable.avatar_1, R.drawable.avatar_2, R.drawable.avatar_3, R.drawable.avatar_4, R.drawable.avatar_5, null, null, null, null),
? ? ? ? ? ? ? ? new Img(R.drawable.avatar_1, R.drawable.avatar_2, R.drawable.avatar_3, R.drawable.avatar_4, R.drawable.avatar_5, R.drawable.avatar_6, null, null, null),
? ? ? ? ? ? ? ? new Img(R.drawable.avatar_1, R.drawable.avatar_2, R.drawable.avatar_3, R.drawable.avatar_4, R.drawable.avatar_5, R.drawable.avatar_6, R.drawable.avatar_7, null, null),
? ? ? ? ? ? ? ? new Img(R.drawable.avatar_1, R.drawable.avatar_2, R.drawable.avatar_3, R.drawable.avatar_4, R.drawable.avatar_5, R.drawable.avatar_6, R.drawable.avatar_7, R.drawable.avatar_8, null),
? ? ? ? ? ? ? ? new Img(R.drawable.avatar_1, R.drawable.avatar_2, R.drawable.avatar_3, R.drawable.avatar_4, R.drawable.avatar_5, R.drawable.avatar_6, R.drawable.avatar_7, R.drawable.avatar_8, R.drawable.avatar_9)
? ? ? ? );

? ? ? ? myAdapter=new MyAdapter(this,imgs);
? ? ? ? binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
? ? ? ? binding.recyclerView.addItemDecoration(new DividerItemDecoration(this,DividerItemDecoration.VERTICAL));
? ? ? ? binding.recyclerView.setAdapter(myAdapter);
? ? }
}

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Android高效安全加載圖片的方法詳解

    Android高效安全加載圖片的方法詳解

    Android開(kāi)發(fā)中消耗內(nèi)存較多一般都是在圖像上面,下面這篇文章主要給大家介紹了關(guān)于Android如何高效安全加載圖片的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-02-02
  • Android ListView下拉刷新上拉自動(dòng)加載更多DEMO示例

    Android ListView下拉刷新上拉自動(dòng)加載更多DEMO示例

    這篇文章主要介紹了Android ListView下拉刷新上拉自動(dòng)加載更多DEMO示例的相關(guān)資料,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下
    2016-07-07
  • Android WebView的使用方法及與JS 相互調(diào)用

    Android WebView的使用方法及與JS 相互調(diào)用

    這篇文章主要介紹了Android WebView的使用方法及與JS 相互調(diào)用的相關(guān)資料,WebView 是 Android 中一個(gè)非常實(shí)用的組&#8203;件, WebView 可以使得網(wǎng)頁(yè)輕松的內(nèi)嵌到app里,還可以直接跟js相互調(diào)用,需要的朋友可以參考下
    2017-07-07
  • Android編程開(kāi)發(fā)之NotiFication用法詳解

    Android編程開(kāi)發(fā)之NotiFication用法詳解

    這篇文章主要介紹了Android編程開(kāi)發(fā)之NotiFication用法,結(jié)合實(shí)例形式較為詳細(xì)的分析了NotiFication的功能、使用技巧與注意事項(xiàng),需要的朋友可以參考下
    2015-12-12
  • Android開(kāi)發(fā)之電話撥號(hào)器和短信發(fā)送器實(shí)現(xiàn)方法

    Android開(kāi)發(fā)之電話撥號(hào)器和短信發(fā)送器實(shí)現(xiàn)方法

    這篇文章主要介紹了Android開(kāi)發(fā)之電話撥號(hào)器和短信發(fā)送器實(shí)現(xiàn)方法,結(jié)合實(shí)例形式較為詳細(xì)的分析了Android電話撥號(hào)器和短信發(fā)送器的具體原理與實(shí)現(xiàn)步驟,需要的朋友可以參考下
    2015-12-12
  • Handler消息傳遞機(jī)制類引入及執(zhí)行流程詳解

    Handler消息傳遞機(jī)制類引入及執(zhí)行流程詳解

    這篇文章主要為大家介紹了Handler消息傳遞機(jī)制類引入及執(zhí)行流程詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-04-04
  • Android Fragment的靜態(tài)注冊(cè)和動(dòng)態(tài)注冊(cè)創(chuàng)建步驟

    Android Fragment的靜態(tài)注冊(cè)和動(dòng)態(tài)注冊(cè)創(chuàng)建步驟

    這篇文章主要介紹了Android Fragment的靜態(tài)注冊(cè)和動(dòng)態(tài)注冊(cè)創(chuàng)建步驟,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-02-02
  • Kotlin List與Set和Map實(shí)例講解

    Kotlin List與Set和Map實(shí)例講解

    集合是可變數(shù)量(可能為0)的一組條目,kotlin標(biāo)準(zhǔn)庫(kù)提供一個(gè)整套用于集合管理的工具,各種集合對(duì)于解決問(wèn)題都具有重要意義,并且經(jīng)常用到。kotlin中的集合與Java基本類似
    2022-10-10
  • android生命周期深入分析(一)

    android生命周期深入分析(一)

    Android 程序的生命周期是由系統(tǒng)控制而非程序自身直接控制,本文將詳細(xì)介紹,需要的朋友可以參考下
    2012-12-12
  • Flutter 給列表增加下拉刷新和上滑加載更多功能

    Flutter 給列表增加下拉刷新和上滑加載更多功能

    在實(shí)際的 App 中,下拉刷新和上滑加載更多是非常常見(jiàn)的交互形式。在 Flutter 中,有 flutter_easyrefresh開(kāi)源插件用于實(shí)現(xiàn)下拉刷新和上滑加載更多。本篇介紹了有狀態(tài)組件和 flutter_easyrefresh 的基本應(yīng)用,同時(shí)使用模擬的方式完成了異步數(shù)據(jù)加載。
    2021-05-05

最新評(píng)論

榆社县| 绥阳县| 宜春市| 红河县| 深州市| 丰原市| 九龙坡区| 永春县| 辽中县| 于田县| 务川| 平陆县| 清丰县| 东宁县| 青河县| 金阳县| 科技| 临高县| 崇义县| 巨鹿县| 察隅县| 稷山县| 青铜峡市| 中西区| 揭东县| 遵义市| 易门县| 九江市| 合山市| 武宣县| 宝坻区| 扎囊县| 江山市| 鞍山市| 河津市| 历史| 汕头市| 平邑县| 通河县| 衡水市| 福建省|