目的
根据书本例题设计图册,并结合Toast的知识内容实现消息提示
工具及环境
使用java语言,在Android studio平台上进行开发
功能设计
通过按钮“上一张”可以往前面翻阅图片,按钮“下一张”可翻阅下一张图片。每一张图片都有相应的文字说明,另外还有第一张图片不能继续往上翻和最后一张图片不可以继续往下翻的相应的消息提示
设计思路
根据书本例题熟悉实现图册的功能和显示,另外运用Toast来实现消息提醒,从而把知识点结合起来进行运用
代码
activity_main.xml(UI设计)
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/introduction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="30sp"
android:layout_marginBottom="30sp"
android:textColor="#000000"
android:gravity="center"
/>
<LinearLayout
andro