我正在尝试为一个简单的温度转换应用程序(Android 开发的新手)创建一个基本的 UI,但我不知道如何创建一个包含两个单独的可 ScrollView 寻呼机的单页,其中一个占据上半部分另一个占据底部。
我正在使用 Eclipse。请随时询问您的回答所需的任何其他信息。
这是布局的粗略图。
最佳答案
I'm trying to create a basic UI for a simple Temperature Conversion app
我不知道为什么温度转换应用程序需要一个 ViewPager
,更不用说同时在同一个 Activity 中使用两个了。
I can't figure out how to create a SINGLE page with two SEPARATE scrollable view pagers, one occupying the top half and the other occupying the bottom one
就 ViewPager
本身而言,使用 LinearLayout
或其他方式垂直堆叠它们。
PagerAdapter
实现会让您更头疼。其中至少有一个必须不是 FragmentPagerAdapter
或 FragmentStatePagerAdapter
。这些实现假定它们是您的 Activity 的唯一此类适配器,我预计有两个会导致冲突。
关于java - 同一 View 上的两个独立的可滚动 fragment - Android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20957311/