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

Android簡(jiǎn)易圖片瀏覽器的實(shí)現(xiàn)

 更新時(shí)間:2022年03月31日 09:16:02   作者:DY.memory  
最近做了一個(gè)圖片瀏覽小程序,本文主要介紹了Android簡(jiǎn)易圖片瀏覽器的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧

閑著沒事,花了半個(gè)小時(shí)用這幾天發(fā)布的部分內(nèi)容來(lái)做一個(gè)Android簡(jiǎn)易圖片瀏覽器小程序,代碼設(shè)main_activity.xml設(shè)計(jì)首界面,設(shè)計(jì)三個(gè)按鈕并賦予id,然后在MainActivity調(diào)用各個(gè)btn的id實(shí)現(xiàn)set方法,每個(gè)方法里實(shí)現(xiàn)intent跳轉(zhuǎn)對(duì)應(yīng)的界面即可!代碼如下:(Main2-3-4Activity的代碼我就不寫了,在建立其MainActivity.java文件時(shí),其xml對(duì)直接出來(lái),并且我的MainActivity.java也沒有寫內(nèi)容)

main_activity.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:layout_height="match_parent"
    tools:context=".MainActivity"
    android:orientation="vertical"
    android:background="@drawable/bj"
 
    >
 
    <TextView
 
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_marginTop="60dp"
        android:textSize="50dp"
        android:textColor="#FF9800"
        android:text="CSDN圖片大全" />
<Button
    android:id="@+id/btn1"
    android:layout_marginTop="40dp"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="動(dòng)漫"
    android:textSize="45sp"
    android:textColor="@color/colorAccent"
 
    />
    <Button
        android:id="@+id/btn2"
        android:layout_marginTop="40dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="游戲"
        android:textSize="45sp"
        android:textColor="@color/colorAccent"
 
        />
    <Button
        android:id="@+id/btn3"
        android:layout_marginTop="40dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="美女"
        android:textSize="45sp"
        android:textColor="@color/colorAccent"
 
        />
 
</LinearLayout>

activity_main2.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#7A3F51B5"
    android:orientation="vertical">
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
 
 
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="歡迎來(lái)到動(dòng)漫世界"
                android:gravity="center"
                android:textSize="40sp"
                />
            <ImageView
                android:background="@drawable/dm"
                android:layout_width="match_parent"
                android:layout_height="350dp"
                />
            <ImageView
                android:background="@drawable/dm1"
                android:layout_width="match_parent"
                android:layout_height="350dp"
                />
            <ImageView
                android:background="@drawable/dm2"
                android:layout_width="match_parent"
                android:layout_height="350dp"
                />
            <ImageView
                android:background="@drawable/dm3"
                android:layout_width="match_parent"
                android:layout_height="350dp"
                />
            <ImageView
                android:background="@drawable/dm4"
                android:layout_width="match_parent"
                android:layout_height="350dp"
                />
            <ImageView
                android:background="@drawable/dm5"
                android:layout_width="match_parent"
                android:layout_height="350dp"
                />
            <ImageView
                android:background="@drawable/dm6"
                android:layout_width="match_parent"
                android:layout_height="350dp"
                />
            <TextView
                android:gravity="center"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="40sp"
                android:text="滑到最后一頁(yè)了哦"
                />
        </LinearLayout>
    </ScrollView>
</LinearLayout>

activity_main3.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FF226F"
    android:orientation="vertical">
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
 
 
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="歡迎來(lái)到游戲世界"
                android:gravity="center"
                android:textSize="40sp"
                />
            <ImageView
                android:background="@drawable/youxi"
                android:layout_width="match_parent"
                android:layout_height="250dp"
                />
            <ImageView
                android:background="@drawable/youxi2"
                android:layout_width="match_parent"
                android:layout_height="250dp"
                />
            <ImageView
                android:background="@drawable/youxi3"
                android:layout_width="match_parent"
                android:layout_height="250dp"
                />
            <ImageView
                android:background="@drawable/youxi4"
                android:layout_width="match_parent"
                android:layout_height="250dp"
                />
            <ImageView
                android:background="@drawable/youxi1"
                android:layout_width="match_parent"
                android:layout_height="250dp"
                />
            <ImageView
                android:background="@drawable/youxi5"
                android:layout_width="match_parent"
                android:layout_height="250dp"
                />
            <ImageView
                android:background="@drawable/youxi6"
                android:layout_width="match_parent"
                android:layout_height="250dp"
                />
            <ImageView
                android:background="@drawable/youxi7"
                android:layout_width="match_parent"
                android:layout_height="250dp"
                />
            <ImageView
                android:background="@drawable/youxi8"
                android:layout_width="match_parent"
                android:layout_height="250dp"
                />
            <TextView
                android:gravity="center"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="40sp"
                android:text="滑到最后一頁(yè)了哦"
                />
        </LinearLayout>
    </ScrollView>
</LinearLayout>

activity_main4.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
 
    android:orientation="vertical">
    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
 
 
            <TextView
                android:background="#9A86AF4C"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="歡迎來(lái)到美女世界"
 
                android:gravity="center"
                android:textSize="40sp"
                />
            <ImageView
 
                android:background="@drawable/mn1"
                android:layout_width="match_parent"
                android:layout_height="550dp"
                />
            <ImageView
                android:background="@drawable/mn2"
                android:layout_width="match_parent"
                android:layout_height="550dp"
                />
            <ImageView
                android:background="@drawable/mn3"
                android:layout_width="match_parent"
                android:layout_height="550dp"
                />
            <ImageView
                android:background="@drawable/mn4"
                android:layout_width="match_parent"
                android:layout_height="550dp"
                />
            <ImageView
                android:background="@drawable/mn5"
                android:layout_width="match_parent"
                android:layout_height="550dp"
                />
            <ImageView
                android:background="@drawable/mn6"
                android:layout_width="match_parent"
                android:layout_height="550dp"
                />
            <ImageView
                android:background="@drawable/mn7"
                android:layout_width="match_parent"
                android:layout_height="550dp"
                />
            <ImageView
                android:background="@drawable/mn8"
                android:layout_width="match_parent"
                android:layout_height="550dp"
                />
            <ImageView
                android:background="@drawable/mn9"
                android:layout_width="match_parent"
                android:layout_height="550dp"
                />
            <ImageView
                android:background="@drawable/mn10"
                android:layout_width="match_parent"
                android:layout_height="550dp"
                />
 
 
            <TextView
                android:gravity="center"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="40sp"
                android:text="滑到最后一頁(yè)了哦"
                />
        </LinearLayout>
    </ScrollView>
</LinearLayout>

MainActivity,java

package com.example.allphones;
 
 
import androidx.appcompat.app.AppCompatActivity;
 
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
 
public class MainActivity extends AppCompatActivity {
private Button btn1,btn2,btn3;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
 
        btn1=findViewById(R.id.btn1);
        btn2=findViewById(R.id.btn2);
        btn3=findViewById(R.id.btn3);
                btn1.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Intent intent=new Intent(MainActivity.this,Main2Activity.class);
                        startActivity(intent);
            }
        });
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
 
                Intent intent=new Intent(MainActivity.this,Main3Activity.class);
                startActivity(intent);
            }
        });
        btn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
 
                Intent intent=new Intent(MainActivity.this,Main4Activity.class);
                startActivity(intent);
 
            }
        });
    }
}

 到此這篇關(guān)于Android簡(jiǎn)易圖片瀏覽器的實(shí)現(xiàn)的文章就介紹到這了,更多相關(guān)Android 圖片瀏覽器內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Android實(shí)現(xiàn)關(guān)機(jī)與重啟的幾種方式(推薦)

    Android實(shí)現(xiàn)關(guān)機(jī)與重啟的幾種方式(推薦)

    這篇文章主要介紹了Android實(shí)現(xiàn)關(guān)機(jī)與重啟的幾種方式(推薦)的相關(guān)資料,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下
    2016-07-07
  • 教你一文搞懂Kotlin中的Jvm注解

    教你一文搞懂Kotlin中的Jvm注解

    這篇文章主要介紹了教你一文搞懂Kotlin中的Jvm注解,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-10-10
  • 詳解Android用Shape制作單邊框圖的兩種思路和坑

    詳解Android用Shape制作單邊框圖的兩種思路和坑

    這篇文章主要介紹了詳解Android用Shape制作單邊框圖的兩種思路和坑,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來(lái)看看吧
    2018-08-08
  • Android實(shí)現(xiàn)水波紋擴(kuò)散效果的實(shí)例代碼

    Android實(shí)現(xiàn)水波紋擴(kuò)散效果的實(shí)例代碼

    這篇文章主要介紹了Android實(shí)現(xiàn)水波紋擴(kuò)散效果的實(shí)例代碼,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來(lái)看看吧
    2018-05-05
  • 淺談Android invalidate 分析

    淺談Android invalidate 分析

    本篇文章主要介紹了淺談Android invalidate 分析,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來(lái)看看吧
    2018-04-04
  • 接口對(duì)象的實(shí)例化在接口回調(diào)中的使用方法

    接口對(duì)象的實(shí)例化在接口回調(diào)中的使用方法

    下面小編就為大家?guī)?lái)一篇接口對(duì)象的實(shí)例化在接口回調(diào)中的使用方法。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來(lái)看看吧
    2017-02-02
  • Android 如何采用Lame編碼器編碼mp3文件

    Android 如何采用Lame編碼器編碼mp3文件

    這篇文章主要介紹了Android 如何采用Lame編碼器編碼mp3文件,幫助大家更好的理解和學(xué)習(xí)使用Android,感興趣的朋友可以了解下
    2021-03-03
  • Android調(diào)節(jié)屏幕亮度實(shí)現(xiàn)代碼

    Android調(diào)節(jié)屏幕亮度實(shí)現(xiàn)代碼

    這篇文章主要介紹了Android調(diào)節(jié)屏幕亮度實(shí)現(xiàn)代碼,調(diào)節(jié)屏幕亮度時(shí),先設(shè)置當(dāng)前activity亮度,再并保存為系統(tǒng)亮度即可,本文分別給出兩個(gè)步驟的實(shí)現(xiàn)代碼,需要的朋友可以參考下
    2015-05-05
  • Android自定義View獲取注冊(cè)驗(yàn)證碼倒計(jì)時(shí)按鈕

    Android自定義View獲取注冊(cè)驗(yàn)證碼倒計(jì)時(shí)按鈕

    這篇文章主要介紹了Android自定義View獲取驗(yàn)證碼倒計(jì)時(shí)按鈕的制作方法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-10-10
  • Android之Intent附加數(shù)據(jù)的兩種實(shí)現(xiàn)方法

    Android之Intent附加數(shù)據(jù)的兩種實(shí)現(xiàn)方法

    這篇文章主要介紹了Android之Intent附加數(shù)據(jù)的兩種實(shí)現(xiàn)方法,以實(shí)例形式較為詳細(xì)的分析了添加數(shù)據(jù)到Intent的相關(guān)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下
    2015-09-09

最新評(píng)論

黔西| 黔江区| 宁河县| 开平市| 大安市| 南丹县| 芷江| 专栏| 山阴县| 邮箱| 东阳市| 德庆县| 保康县| 冷水江市| 新和县| 淳化县| 航空| 抚顺市| 桃园市| 南涧| 资中县| 新邵县| 邓州市| 海淀区| 眉山市| 柘城县| 昌平区| 宁阳县| 盱眙县| 马公市| 汝南县| 浪卡子县| 博爱县| 台北县| 缙云县| 科技| 汝南县| 会泽县| 化州市| 湘西| 阿荣旗|