Java 如何在屏幕上充满textview和imageview的scrollview下添加两个按钮(一个在后面,一个在下一个),android?
我想问一下,我可以在scrollview下添加next和back按钮吗?在一个屏幕上,它填充了textview和imageview,这两个屏幕都有android的xml、java和屏幕截图结果 这是我想问的图片。 我从这里得到: 实际上,我真正想要的是一个类似博客的视图(当你在上面的文本中看到一个可以滚动的图像时,它的结尾是左下角的“后退”按钮,该按钮将转到上一页,而“下一步”按钮将转到反面的下一页) 我真的想要一个xml、java的例子,以及它的屏幕截图结果 再次感谢大家Java 如何在屏幕上充满textview和imageview的scrollview下添加两个按钮(一个在后面,一个在下一个),android?,java,android,xml,Java,Android,Xml,我想问一下,我可以在scrollview下添加next和back按钮吗?在一个屏幕上,它填充了textview和imageview,这两个屏幕都有android的xml、java和屏幕截图结果 这是我想问的图片。 我从这里得到: 实际上,我真正想要的是一个类似博客的视图(当你在上面的文本中看到一个可以滚动的图像时,它的结尾是左下角的“后退”按钮,该按钮将转到上一页,而“下一步”按钮将转到反面的下一页) 我真的想要一个xml、java的例子,以及它的屏幕截图结果 再次感谢大家 非常感谢你的回答。
非常感谢你的回答。谢谢这就是XML的用途 用xml创建布局并通过java导入 你会想为中心的酒吧创建你自己的“酒吧布局”,尽管我想你可以填充3个单独的线性布局来达到同样的效果,制作一个单独的布局并放在这里会让你更容易阅读,并跟随正在发生的事情 下面是一个xml布局的模型,您可以使用它来获得与图片中的视图非常相似的视图。我没有测试过这个,这是在飞行中,所以它可能不是完美的,但它会让你非常接近你所寻找的
<LinearLayout>
android:orientation="vertical"
android:weightSum=10
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout>
android:weight=1
android:layout_height=0dp
android:layout_width="match_parent">
<TextView>
android:width="wrap_content"
android:id="@+id/info_bar"
android:centerHorizontal="true"/>
</RelativeLayout>
<LinearLayout>
android:weight=8
android:width="match_parent"
android:height=0dp>
<TextView>
android:id="@+id/text_view1"
android:width="match_parent"
android:height="wrap_content"/>
<com.yourpackage.yourapp.createabarlayout>
</com.yourpackage.yourapp.createabarlayout>
<com.yourpackage.yourapp.createabarlayout>
</com.yourpackage.yourapp.createabarlayout>
<com.yourpackage.yourapp.createabarlayout>
</com.yourpackage.yourapp.createabarlayout>
</LinearLayout>
<RelativeLayout>
android:weight=1
android:layout_width="match_parent"
android:layout_height=0dp>
<Button>
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/back_button"
android:text="@string/back_button_hint"/>
<TextView>
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/steps_textview"
android:text="@string/steps_hint"
android:centerHorizontal="true"/>
<Button>
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/next_button"
android:text="@string/next_button_hint"/>
</RelativeLayout>
</LinearLayout>
android:orientation=“垂直”
android:weightSum=10
android:layout\u width=“匹配父项”
android:layout\u height=“match\u parent”>
android:weight=1
android:layout_height=0dp
android:layout\u width=“match\u parent”>
android:width=“包装内容”
android:id=“@+id/info_栏”
android:centerHorizontal=“true”/>
android:weight=8
android:width=“匹配父对象”
android:height=0dp>
android:id=“@+id/text_view1”
android:width=“匹配父对象”
android:height=“包装内容”/>
android:weight=1
android:layout\u width=“匹配父项”
android:layout_height=0dp>
android:layout\u width=“包装内容”
android:layout\u height=“match\u parent”
android:id=“@+id/后退按钮”
android:text=“@string/back\u button\u hint”/
android:layout\u width=“包装内容”
android:layout\u height=“match\u parent”
android:id=“@+id/steps\u textview”
android:text=“@string/steps\u hint”
android:centerHorizontal=“true”/>
android:layout\u width=“包装内容”
android:layout\u height=“match\u parent”
android:id=“@+id/next_按钮”
android:text=“@string/next\u button\u hint”/
Stack Overflow是问答网站,不是编码服务。请概述你尝试了什么,以及你到底被困在哪里。否则,此问题将因离题而关闭。谢谢提醒。是的,我已经试过了,而且卡住了。因此,我在这里问。再次谢谢,谢谢。为什么?这是否意味着我们必须用我们自己的软件更改“yourpackagename.yourapp”?三次?为我不清楚的理解道歉。这就是我在回答“是”时所说的。您将要考虑创建自己的BayStand并将其包含在这一点中,因为您将更容易管理XML,不过,同样,您将能够使用大多数想要达到预期效果的布局。