モバイル ソフトウェア開発 レッスン 5 - 最初の Android アプリケーション

2022年夏「モバイルソフトウェア開発」ラボレポート

氏名:xxx学籍番号2002000xxxx

名前と学籍番号は?        

xxx2002000xxxx

この研究室はどのコースに属していますか?

中国海洋大学22夏期「モバイルソフトウェア開発」

実験名は?          

実験 5: 最初の Android アプリケーション

ブログアドレス?          

Github の倉庫のアドレス?

1. 実験の目的、

WeChat の「ディスカバリー」ページを真似てリスト レイアウトを作成し、Textview imageview、LinearLayout の使用方法を学びます。

第二に、実験手順

1、プロジェクト作成

2、ページ構成

 

 

3、ビューデザイン

 

4、ロジック実装

 

第三に、プログラムの実行結果

 

コード全体:

<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:background ="#e5e5e5"
    android:layout_height="match_parent"
    android:orientation="vertical"
    >

    <LinearLayout
        android:layout_marginTop="15dp"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="#fff "
        android:orientation="horizo​​ntal">

        <ImageView
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_gravity="center_vertical"
            android:layout_marginLeft="15dp"
            android:background="@mipmap/icon_pengyou" />
        <TextView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginLeft="10dp"
            android:layout_weight="1"
            android :gravity="center_vertical"
            android:text="朋友圈"
            android:textColor="#333"
            android:textSize="18dp"
            android:textStyle="bold" />

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginRight="15dp"
            android:background="@mipmap/right" />
    </LinearLayout>

    <LinearLayout
        android:layout_marginTop="30dp"
        android:background="#fff"
        android:orientation="horizo​​ntal"
        android:layout_width ="match_parent"
        android:layout_height="60dp">
        <ImageView
            android:layout_width="40dp"
            android:layout_marginLeft="15dp"
            android:layout_gravity="center_vertical"
            android:layout_height="40dp"
            android:background="@mipmap/hand2"/>
        <TextView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:text="扫一扫"
            android:layout_marginLeft="10dp"
            android:textStyle="bold"
            android:textColor="#333"
            android:textSize="18dp"
            android:gravity=" center_vertical"
            android:layout_weight="1"/>
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="15dp"
            android:layout_gravity="center_vertical"
            android:background="@mipmap/right 」/>
    </LinearLayout>

    <LinearLayout
        android:background="#fff"
        android:orientation="horizo​​ntal"
        android:layout_width="match_parent"
        android:layout_height="60dp">
        <ImageView
            android:layout_width="40dp"
            android:layout_marginLeft="15dp"
            android:layout_gravity= "center_vertical"
            android:layout_height="40dp"
            android:background="@mipmap/shake3"/>
        <TextView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:text="摇一摇"
            android:layout_marginLeft="10dp"
            android:textStyle="bold"
            android:textColor="#333"
            android:textSize="18dp"
            android:gravity="center_vertical"
            android:layout_weight="1"/>
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight ="15dp"
            android:layout_gravity="center_vertical"
            android:background="@mipmap/right"/>
    </LinearLayout>

    <LinearLayout
        android:layout_marginTop="30dp"
        android:background="#fff"
        android:orientation="水平"
        android:layout_width="match_parent"
        android:layout_height="60dp">
        <ImageView
            android:layout_width="40dp"
            android:layout_marginLeft="15dp"
            android:layout_gravity="center_vertical"
            android:layout_height="40dp"
            android:background="@mipmap/eye4"/>
        <TextView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:text="看一看"
            android:layout_marginLeft="10dp"
            android:textStyle="bold"
            android:textColor="#333"
            android:textSize =18dp"
            android:gravity="center_vertical"
            android:layout_weight="1"/>
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="15dp"
            android:layout_gravity="center_vertical" android
            :background="@mipmap/right"/ >
    </LinearLayout>

    <LinearLayout
        android:background="#fff"
        android:orientation="horizo​​ntal"
        android:layout_width="match_parent"
        android:layout_height="60dp">
        <ImageView
            android:layout_width="40dp"
            android:layout_marginLeft="15dp"
            android:layout_gravity="center_vertical"
            android:layout_height="40dp"
            android:background="@mipmap/search5"/>
        <TextView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:text="搜一搜"
            android:layout_marginLeft="10dp "
            android:textStyle="bold"
            android:textColor="#333"
            android:textSize="18dp"
            android:gravity="center_vertical"
            android:layout_weight="1"/>
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="15dp"
            android:layout_gravity="center_vertical"
            android:background="@mipmap/right"/>
    </LinearLayout>

    <LinearLayout
        android:layout_marginTop="30dp"
        android:background="#fff"
        android:orientation="horizo​​ntal"
        android:layout_width ="match_parent"
        android:layout_height="60dp">
        <ImageView
            android:layout_width="40dp"
            android:layout_marginLeft="15dp"
            android:layout_gravity="center_vertical"
            android:layout_height="40dp"
            android:background="@mipmap/game7"/>
        <TextView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:text="游戏"
            android:layout_marginLeft="10dp"
            android:textStyle="bold"
            android:textColor="#333"
            android:textSize="18dp"
            android:gravity="center_vertical"
            android:layout_weight="1"/>
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="15dp"
            android:layout_gravity="center_vertical"
            android:background="@mipmap/right"/>
    </LinearLayout>

    <LinearLayout
        android:background="#fff"
        android:orientation="horizo​​ntal"
        android:layout_width="match_parent"
        android:layout_height="60dp">
        <ImageView
            android:layout_width="40dp"
            android:layout_marginLeft="15dp"
            android:layout_gravity="center_vertical"
            android:layout_height=" 40dp"
            android:background="@mipmap/shopping6"/>
        <TextView
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:text="购物"
            android:layout_marginLeft="10dp"
            android:textStyle="太字"
            android:textColor="#333"
            android:textSize="18dp"
            android:gravity="center_vertical"
            android:layout_weight="1"/>
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="15dp"
            android:layout_gravity= "center_vertical"
            android:background="@mipmap/right"/>
    </LinearLayout>

    <LinearLayout
        android:layout_marginTop="30dp"
        android:background="#fff"
        android:orientation="horizo​​ntal"
        android:layout_width="match_parent"
        android:layout_height="60dp">
        <ImageView
            android:layout_width="40dp"
            android:layout_marginLeft="15dp"
            android:layout_gravity="center_vertical"
            android:layout_height="40dp"
            android:background="@mipmap/prog8"/>
        <TextView
            android:layout_width="0dp"
            android :layout_height="match_parent"
            android:text="小程序"
            android:layout_marginLeft="10dp"
            android:textStyle="bold"
            android:textColor="#333"
            android:textSize="18dp"
            android:gravity="center_vertical"
            android:layout_weight="1"/>
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="15dp"
            android:layout_gravity="center_vertical"
            android:background="@mipmap/right"/>
    </LinearLayout>

</LinearLayout>

4番目、問題の概要と経験

    このクラスは私にとって非常に有益であり、レイアウトの作成方法を学びました。また、コンポーネントを柔軟に使用することも学びました。

おすすめ

転載: blog.csdn.net/m0_55933489/article/details/126528963