国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Android Studio初學(xué)者實(shí)例:RecyclerView學(xué)習(xí)--模仿今日頭條

這篇具有很好參考價(jià)值的文章主要介紹了Android Studio初學(xué)者實(shí)例:RecyclerView學(xué)習(xí)--模仿今日頭條。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

本案例來(lái)自于學(xué)校的一個(gè)簡(jiǎn)單的課程實(shí)驗(yàn)

先看效果圖,可以顯然的看到,一些item是不同的布局,而其他布局就是簡(jiǎn)單的布局嵌套

Android Studio初學(xué)者實(shí)例:RecyclerView學(xué)習(xí)--模仿今日頭條

看一下xml代碼:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:background="@color/light_gray_color"

    android:layout_height="match_parent"
    android:theme="@style/Theme.AppCompat.NoActionBar"
    tools:context=".MainActivity40">
<include layout="@layout/title_bar"/>
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:background="@color/white">
        <TextView
            style="@style/tvStyle"
            android:text="推薦"
            android:textColor="#000000"/>
        <TextView
            style="@style/tvStyle"
            android:text="熱點(diǎn)"
            android:textColor="#000000"/>
        <TextView
            style="@style/tvStyle"
            android:text="視頻"
            android:textColor="#000000"/>
        <TextView
            style="@style/tvStyle"
            android:text="北京"
            android:textColor="#000000"/>
        <TextView
            style="@style/tvStyle"
            android:text="熱點(diǎn)"
            android:textColor="#000000"/>
        <TextView
            style="@style/tvStyle"
            android:text="娛樂(lè)"
            android:textColor="#000000"/>
    </LinearLayout>
    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#eeeeee"/>
    <androidx.recyclerview.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/rv_list"/>
</LinearLayout>

?XML代碼中部分重復(fù)樣式寫(xiě)入到了style文件中

看一下加入style.xm的代碼,這個(gè)文件是存放在value文件夾下,存放樣式、主題等。

<style name="tvStyle">
        <item name="android:layout_width">wrap_content</item>
        <item name="android:layout_height">match_parent</item>
        <item name="android:padding">10dp</item>
        <item name="android:gravity">center</item>
        <item name="android:textSize">15sp</item>
    </style>

看一下Activity的Java代碼

使用數(shù)組存放標(biāo)題、內(nèi)容、時(shí)間、圖片等數(shù)據(jù)(因?yàn)楝F(xiàn)在還只是死數(shù)據(jù))

setDate(單詞拼錯(cuò)了?。?該函數(shù),就是將數(shù)據(jù)填充到NewsList(一個(gè)泛型List)中

然后就是new一個(gè)自己聲明的一個(gè)自定義適配器,使用Listview的setAdapter方法設(shè)置其適配器

public class MainActivity40 extends AppCompatActivity {
private  String[] titles={"各地餐企齊行動(dòng),杜絕餐飲浪費(fèi)","花菜有人焯水,有人直接炒,都錯(cuò)了,看飯店大廚如何做","睡覺(jué)時(shí),雙腳突然蹬一下,有踩空感,像從高樓墜落,是咋回事?","實(shí)拍外賣小哥砸開(kāi)小吃店的卷簾門(mén)救火,滅火后淡定決定繼續(xù)送外賣",
        "還沒(méi)成熟就被迫提前采摘,8毛一斤卻沒(méi)人要,果農(nóng)無(wú)奈,不摘不行","大會(huì)、大展、大賽一起來(lái),北京電競(jìng)“好嗨喲”"};
private String[] names={"央視新聞客戶端","味美食記","民富康健康","生活小記","禾木報(bào)告","燕鳴"};
private String[] comments={"1234評(píng)","14214評(píng)","534評(píng)","134評(píng)","1353評(píng)","876評(píng)"};
private String[]times={"剛剛","6小時(shí)前","8小時(shí)前","2小時(shí)前","剛剛","4小時(shí)前"};
private  int[] icons1={R.drawable.food,R.drawable.takeout,R.drawable.e_sports};
private int[] icons2={R.drawable.sleep1,R.drawable.sleep2,R.drawable.sleep3,R.drawable.fruit1,R.drawable.fruit2,R.drawable.fruit3};
private int[] types={1,1,2,1,2,1};
private RecyclerView mRecyclerView;
private myAdapter myAdapter;
private List<NewsBean> NewsList;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main40);
        setDate();
        mRecyclerView=findViewById(R.id.rv_list);
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        myAdapter=new myAdapter(MainActivity40.this,NewsList);
        mRecyclerView.setAdapter(myAdapter);
    }

    private void setDate(){
            NewsList=new ArrayList<NewsBean>();
            NewsBean bean;
        for (int i = 0; i < titles.length; i++) {
            bean=new NewsBean();
            bean.setId(i+1);
            bean.setTitle(titles[i]);
            bean.setName(names[i]);
            bean.setComment(comments[i]);
            bean.setTime(times[i]);
            bean.setType(types[i]);
            switch (i){
                case 0:
                    List<Integer> imgList0=new ArrayList<>();
                    bean.setImgList(imgList0);
                    break;
                case 1:
                    List<Integer> imgList1=new ArrayList<>();
                    imgList1.add(icons1[i-1]);
                    bean.setImgList(imgList1);
                    break;
                case 2:
                    List<Integer> imgList2=new ArrayList<>();
                    imgList2.add(icons2[i-2]);
                    imgList2.add(icons2[i-1]);
                    imgList2.add(icons2[i]);
                    bean.setImgList(imgList2);
                    break;
                case 3:
                    List<Integer> imgList3=new ArrayList<>();
                    imgList3.add(icons1[i-2]);
                    bean.setImgList(imgList3);
                    break;
                case 4:
                    List<Integer> imgList4=new ArrayList<>();
                    imgList4.add(icons2[i-1]);
                    imgList4.add(icons2[i]);
                    imgList4.add(icons2[i+1]);
                    bean.setImgList(imgList4);
                    break;
                case 5:
                    List<Integer> imgList5=new ArrayList<>();
                    imgList5.add(icons1[i-3]);
                    bean.setImgList(imgList5);

                    break;
            }
            NewsList.add(bean);

        }
    }

}

其中涉及到了適配器,話不多說(shuō),上適配器代碼,適配器是連接數(shù)據(jù)與Listview的一個(gè)“橋梁”

RecyclerView與ListView的適配器其實(shí)共同特征有很多。

在自定義的適配器中,首先是一個(gè)構(gòu)造方法,來(lái)獲取當(dāng)前上下文以及數(shù)據(jù)列表

class myAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
    private Context mContext;
    private List<NewsBean> NewsList;
    public myAdapter(Context context, List<NewsBean> list){
        this.mContext=context;
        this.NewsList=list;
    }

    @NonNull
    @NotNull
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull @NotNull ViewGroup parent, int viewType) {
        View itemView=null;
        RecyclerView.ViewHolder holder=null;
        if(viewType==1){
            itemView= LayoutInflater.from(mContext).inflate(R.layout.list_item_one,parent,false);
            holder=new ViewHolder1(itemView);
        }else  if(viewType==2){
            itemView= LayoutInflater.from(mContext).inflate(R.layout.list_item_two,parent,false);
            holder=new ViewHolder2(itemView);
        }
        return holder;
    }

    @Override
    public int getItemViewType(int position) {
        return  NewsList.get(position).getType();
    }

    @Override
    public void onBindViewHolder(@NonNull @NotNull RecyclerView.ViewHolder holder, int position) {
        NewsBean bean=NewsList.get(position);
        if(holder instanceof ViewHolder1){
            if(position==0){
                ((ViewHolder1)holder).iv_top.setVisibility(View.VISIBLE);
                ((ViewHolder1)holder).iv_img.setVisibility(View.GONE);
            }else {
                ((ViewHolder1)holder).iv_top.setVisibility(View.GONE);
                ((ViewHolder1)holder).iv_img.setVisibility(View.VISIBLE);
            }
            ((ViewHolder1)holder).title.setText(bean.getTitle());
            ((ViewHolder1)holder).name.setText(bean.getName());
            ((ViewHolder1)holder).comment.setText(bean.getComment());
            ((ViewHolder1)holder).time.setText(bean.getTime());
            if (bean.getImgList().size()==0)return;
            ((ViewHolder1)holder).iv_img.setImageResource(bean.getImgList().get(0));
        }else  if(holder instanceof ViewHolder2){
            ((ViewHolder2) holder).title.setText(bean.getTitle());
            ((ViewHolder2) holder).name.setText(bean.getName());
            ((ViewHolder2) holder).comment.setText(bean.getComment());
            ((ViewHolder2) holder).time.setText(bean.getTime());
            ((ViewHolder2) holder).iv_img1.setImageResource(bean.getImgList().get(0));
            ((ViewHolder2) holder).iv_img2.setImageResource(bean.getImgList().get(1));
            ((ViewHolder2) holder).iv_img3.setImageResource(bean.getImgList().get(2));

        }
    }

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

    class  ViewHolder1 extends RecyclerView.ViewHolder {
        ImageView iv_top,iv_img;
        TextView title,name,comment,time;
        public ViewHolder1(@NonNull @NotNull View itemView) {
            super(itemView);
            iv_top=itemView.findViewById(R.id.iv_top);
            iv_img=itemView.findViewById(R.id.iv_img);
            title=itemView.findViewById(R.id.tv_title);
            name=itemView.findViewById(R.id.tv_name);
            comment=itemView.findViewById(R.id.tv_comment);
            time=itemView.findViewById(R.id.tv_time);


        }
    }
    class  ViewHolder2 extends RecyclerView.ViewHolder {
        ImageView iv_img1,iv_img2,iv_img3;
        TextView title,name,comment,time;
        public ViewHolder2(@NonNull @NotNull View itemView) {
            super(itemView);
            iv_img1=itemView.findViewById(R.id.iv_img1);
            iv_img2=itemView.findViewById(R.id.iv_img2);
            iv_img3=itemView.findViewById(R.id.iv_img3);

            title=itemView.findViewById(R.id.tv_title);
            name=itemView.findViewById(R.id.tv_name);
            comment=itemView.findViewById(R.id.tv_comment);
            time=itemView.findViewById(R.id.tv_time);


        }
    }

}

代碼解說(shuō)將會(huì)在后續(xù)補(bǔ)充

5-3?? 現(xiàn)在補(bǔ)充一下 list_item_one.xml與list_item_two.xml,這兩個(gè)布局文件是Listview中兩個(gè)item

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="90dp"
    android:layout_marginBottom="8dp"
    android:background="@color/white"
    android:padding="8dp">
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/ll_info"
        android:orientation="vertical">
        <TextView
            android:layout_width="280dp"
            android:layout_height="wrap_content"
            android:id="@+id/tv_title"
            android:maxLines="2"
            android:textColor="#3c3c3c"
            android:textSize="16sp"/>
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">
            <ImageView
                android:layout_width="20dp"
                android:layout_height="20dp"
                android:id="@+id/iv_top"
                android:layout_alignParentBottom="true"
                android:src="@drawable/aplle"/>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_toRightOf="@+id/iv_top"
                android:orientation="horizontal">
                <TextView
                    style="@style/tvInfo"
                    android:id="@+id/tv_name"/>
                <TextView
                    android:id="@+id/tv_comment"
                    style="@style/tvInfo"/>
                <TextView
                    android:id="@+id/tv_time"
                    style="@style/tvInfo"/>

            </LinearLayout>
        </RelativeLayout>
    </LinearLayout>
<ImageView
    android:layout_width="match_parent"
    android:layout_height="90dp"
    android:id="@+id/iv_img"
    android:layout_toRightOf="@id/ll_info"
    android:padding="3dp"/>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="8dp"
    android:background="@color/white"
    android:padding="8dp">
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/tv_title"
        android:maxLines="2"
        android:padding="8dp"
        android:textColor="#3c3c3c"
        android:textSize="16sp"/>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/ll_img"
        android:layout_below="@id/tv_title"
        android:orientation="horizontal">
        <ImageView
            android:id="@+id/iv_img1"
            style="@style/ivImg"/>
        <ImageView
            android:id="@+id/iv_img2"
            style="@style/ivImg"/>
        <ImageView
            android:id="@+id/iv_img3"
            style="@style/ivImg"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/ll_img"
        android:orientation="vertical"
        android:padding="8dp">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
            <TextView
                android:id="@+id/tv_name"
                style="@style/tvInfo"/>
            <TextView
                android:id="@+id/tv_comment"
                style="@style/tvInfo"/>
            <TextView
                android:id="@+id/tv_time"
                style="@style/tvInfo"/>
        </LinearLayout>
    </LinearLayout>
</RelativeLayout>

補(bǔ)充一下NewBean? 其實(shí)就是個(gè)實(shí)體類啦? 其中g(shù)et、set方法以及構(gòu)造方法可以快速生成

Android Studio初學(xué)者實(shí)例:RecyclerView學(xué)習(xí)--模仿今日頭條

import java.util.List;

public class NewsBean {
    private  int id;
    private String title;
    private List<Integer> imgList;
    private String name;
    private String comment;
    private String time;
    private int type;

    public NewsBean() {
    }

    public NewsBean(int id, String title, List<Integer> imgList, String name, String comment, String time, int type) {
        this.id = id;
        this.title = title;
        this.imgList = imgList;
        this.name = name;
        this.comment = comment;
        this.time = time;
        this.type = type;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<Integer> getImgList() {
        return imgList;
    }

    public void setImgList(List<Integer> imgList) {
        this.imgList = imgList;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }
}

6-26補(bǔ)充一下使用的頂部布局

在res/layout下創(chuàng)建title_bar.xml文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-462415.html

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:orientation="horizontal"
    android:paddingLeft="10dp"
    android:background="#d33d3c"
    android:paddingRight="10dp"
    android:layout_height="50dp">
<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:text="今日頭條"
    android:textColor="@color/white"
    android:textSize="22sp"/>
    <EditText
        android:layout_width="match_parent"
        android:layout_height="35dp"
        android:layout_gravity="center_vertical"
        android:layout_marginStart="15dp"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="15dp"
        android:gravity="center_vertical"
        android:textColor="@color/black"
        android:hint="搜索"
        android:textColorHint="@color/gray_color"
        android:paddingLeft="30dp"/>
</LinearLayout>

到了這里,關(guān)于Android Studio初學(xué)者實(shí)例:RecyclerView學(xué)習(xí)--模仿今日頭條的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Android Studio初學(xué)者實(shí)例:仿網(wǎng)易音樂(lè)播放器

    Android Studio初學(xué)者實(shí)例:仿網(wǎng)易音樂(lè)播放器

    本期帶來(lái)的是以Service為主要的知識(shí)點(diǎn)的網(wǎng)易音樂(lè)播放器 看一下效果圖 ?首先項(xiàng)目準(zhǔn)備: 在res下新建raw文件夾,并在文件夾中添加喜愛(ài)的mp3音樂(lè) ?OK,第一步,先寫(xiě)一個(gè)背景文件,在res/drawable文件夾中新建xml文件: btn_bg_selector.xml ?編寫(xiě)主界面代碼activity_main.xml 編寫(xiě)MusicServic

    2024年02月05日
    瀏覽(26)
  • Android Studio初學(xué)者實(shí)例:ContentProvider讀取手機(jī)通訊錄

    Android Studio初學(xué)者實(shí)例:ContentProvider讀取手機(jī)通訊錄

    該實(shí)驗(yàn)是通過(guò)ContentProvider讀取手機(jī)通訊錄 知識(shí)點(diǎn)包含了RecyclerView控件、UriMatcher、ContentResolver 先看效果,顯示手機(jī)通訊錄 ?首先是界面的布局代碼 activity_main59.xml 其次是RecyclerView的item布局代碼,其中使用了CardView是為了方便快捷的弄個(gè)圓角儲(chǔ)來(lái) main59_item.xml 一個(gè)聯(lián)系人的實(shí)體

    2024年02月03日
    瀏覽(28)
  • Android Studio初學(xué)者實(shí)例:SQLite實(shí)驗(yàn):綠豆通訊錄

    Android Studio初學(xué)者實(shí)例:SQLite實(shí)驗(yàn):綠豆通訊錄

    本次實(shí)驗(yàn)是使用SQLite對(duì)一個(gè)通訊錄表進(jìn)行簡(jiǎn)單增刪改查 以下是實(shí)驗(yàn)效果: ?首先是繼承SQLiteOpenHelper的數(shù)據(jù)庫(kù)自定義類 對(duì)于此類必須繼承于SQLiteOpenHelper ,當(dāng)new創(chuàng)造該類的實(shí)例的時(shí)候會(huì)執(zhí)行創(chuàng)建數(shù)據(jù)庫(kù)以及表的操作,例如本代碼中數(shù)據(jù)庫(kù)名為itcast,數(shù)據(jù)庫(kù)表名為informatoin。db

    2024年02月08日
    瀏覽(29)
  • git初學(xué)者使用教程(包含Android studio中g(shù)it使用)

    git初學(xué)者使用教程(包含Android studio中g(shù)it使用)

    參考博客 git地址 如: 點(diǎn)擊創(chuàng)建后會(huì)出這個(gè)頁(yè)面 我推薦使用這個(gè)部分命令行來(lái)設(shè)置倉(cāng)庫(kù) 在想要?jiǎng)?chuàng)建git倉(cāng)庫(kù)的文件夾右鍵打開(kāi)Git Bash Here(前提是安裝了git) 輸入命令(每次輸入一句) 3. 右鍵打開(kāi)Git設(shè)置 在Git中就會(huì)出現(xiàn)用戶信息(我電腦的Git用戶是別人的,我沒(méi)有修改) 先看

    2024年02月06日
    瀏覽(31)
  • R語(yǔ)言爬蟲(chóng)實(shí)例 初學(xué)者自用

    R語(yǔ)言爬蟲(chóng)實(shí)例 初學(xué)者自用

    本文記錄了使用rvest RSelenium 包進(jìn)行爬蟲(chóng)與網(wǎng)頁(yè)渲染的相關(guān)知識(shí)點(diǎn)及本人的編程操作過(guò)程。涉及到基本爬取操作、爬取缺失部分如何處理、操作網(wǎng)頁(yè)過(guò)濾等步驟。 本人非計(jì)算機(jī)專業(yè),如有措辭不慎敬請(qǐng)?zhí)岢觥?這學(xué)期為了湊學(xué)分,選了一門(mén)R語(yǔ)言的課,才發(fā)現(xiàn)R語(yǔ)言遠(yuǎn)比我們想象

    2024年02月02日
    瀏覽(32)
  • OpenCV實(shí)例解析(OpenCV初學(xué)者)

    OpenCV實(shí)例解析(OpenCV初學(xué)者)

    一、計(jì)算機(jī)視覺(jué) 1.定義:給計(jì)算機(jī)安裝上眼睛(照相機(jī))和大腦(算法),讓其能感知周圍的環(huán)境。它是對(duì)生物視覺(jué)的一種模擬,通常的做法是通過(guò)對(duì)采集的圖像或視頻進(jìn)行處理來(lái)獲得相應(yīng)場(chǎng)景的三維信息。 2.應(yīng)用: 計(jì)算機(jī)科學(xué)和工程、信號(hào)處理、物理學(xué)、應(yīng)用數(shù)學(xué)和統(tǒng)計(jì)學(xué)

    2024年02月08日
    瀏覽(19)
  • 在 Android 中使用 C/C++:初學(xué)者綜合指南

    在 Android 中使用 C/C++:初學(xué)者綜合指南

    Java 作為一種編程語(yǔ)言,具有許多良好的功能,使其成為應(yīng)用程序開(kāi)發(fā)的首選語(yǔ)言。它獨(dú)立于平臺(tái)(因?yàn)樘摂M機(jī)執(zhí)行)、JIT 編譯、多線程支持以及為程序員提供的富有表現(xiàn)力的簡(jiǎn)單語(yǔ)法。由于其與平臺(tái)無(wú)關(guān)的特性,Java 包可以跨 CPU 架構(gòu)移植,這使得庫(kù)開(kāi)發(fā)變得更加容易,從而

    2024年03月13日
    瀏覽(30)
  • 【深度學(xué)習(xí)】深度強(qiáng)化學(xué)習(xí)初學(xué)者指南

    ????????GAN(Generative Adversarial Networks)是一種深度學(xué)習(xí)模型,它由兩個(gè)神經(jīng)網(wǎng)絡(luò)組成:一個(gè)生成網(wǎng)絡(luò)和一個(gè)判別網(wǎng)絡(luò)。生成網(wǎng)絡(luò)學(xué)習(xí)如何生成類似于給定數(shù)據(jù)集的新數(shù)據(jù),而判別網(wǎng)絡(luò)則學(xué)習(xí)如何區(qū)分生成網(wǎng)絡(luò)生成的數(shù)據(jù)和原始數(shù)據(jù)。這兩個(gè)網(wǎng)絡(luò)相互競(jìng)爭(zhēng),使得生成器越來(lái)

    2024年02月13日
    瀏覽(51)
  • 初學(xué)者怎么學(xué)習(xí)c++(合集)

    初學(xué)者怎么學(xué)習(xí)c++(合集)

    ? 學(xué)習(xí)c++方法1 找一本好的書(shū)本教材,輔助看教學(xué)視頻。好的教材,可以讓你更快更好的進(jìn)入C/C++的世界。在校學(xué)生的話,你們的教材通常都是不錯(cuò)的。如果是自學(xué),推薦使用譚浩強(qiáng)出的C/C++經(jīng)典入門(mén)教材??匆曨l是學(xué)習(xí)比較直觀的方式。建議先看課本,不懂的地方,更看視頻

    2024年02月16日
    瀏覽(31)
  • Mac安裝配置Visual Studio Code(vscode)以及Java環(huán)境詳細(xì)教程(初學(xué)者必看)

    Mac安裝配置Visual Studio Code(vscode)以及Java環(huán)境詳細(xì)教程(初學(xué)者必看)

    原本博主今天想繼續(xù)給大家出Java接下來(lái)的教程,但是就在昨天我在配置vscode的時(shí)候遇到了一些問(wèn)題,Windows系統(tǒng)的小伙伴配置起來(lái)肯定很方便,但是在Mac的小伙伴卻顯得十分無(wú)奈,所以我想給大家出一篇Mac的Visual Studio Code配置以及Java環(huán)境搭建教程! 博客主頁(yè):Jovy.的博客_CSDN博客-領(lǐng)

    2024年02月01日
    瀏覽(30)

覺(jué)得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包