小编Noo*_*der的帖子

如何制作多个页面,我可以在应用程序中使用按钮,并使图像按钮链接到这些页面?

所以这是我的第一个应用程序,我正在尝试编码,需要一些按钮帮助.在寻找答案后,我找不到一个我理解的答案.我希望能够为应用程序创建不同的页面并将imagebuttons链接建立到这些页面.这是我按钮的最基本代码.请尝试解释在哪里放置代码等.提前感谢.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">

    <ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/imageButton"
        android:background="@drawable/home_button"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:nestedScrollingEnabled="true" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

android button android-imagebutton

5
推荐指数
2
解决办法
3万
查看次数

标签 统计

android ×1

android-imagebutton ×1

button ×1