Android - 在 tabhost 之后添加按钮未显示在每个选项卡中
所以我想要一个底部按钮,以便它显示在所有选项卡中,但我似乎无法使其在每个选项卡屏幕的底部可用。我只有第一个选项卡,其中填充了编辑文本元素和微调器。但即使设置滚动视图后,该按钮也不会显示,因为所有元素都超过屏幕尺寸。这是 xml:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TabHost
android:id="@+id/personalfiletab"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="56dp">
<ScrollView android:id="@+id/ScrollView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableLayout
android:id="@+id/pessoal_tab"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true">
<include android:id="@+id/first" layout="@layout/ecra_editpersonalfile_infoform" />
</TableLayout>
<TableLayout android:id="@+id/morada__contacto_tab"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true">
<include android:id="@+id/first" layout="@layout/ecra_editpersonalfile_moradacontactoform" />
</TableLayout>
<TableLayout
android:id="@+id/profissional_tab"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true">
<include android:id="@+id/first" layout="@layout/ecra_editpersonalfile_infoproform" />
</TableLayout>
<TableLayout
android:id="@+id/documentacao_tab"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true">
<include android:id="@+id/first" layout="@layout/ecra_editpersonalfile_documentacaoform" />
</TableLayout>
</LinearLayout>
</ScrollView>
</FrameLayout>
</LinearLayout>
</TabHost>
<Button
android:text="submit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/submitprofileButton">
</Button>
</LinearLayout>
但是该按钮并未显示在每个选项卡的屏幕底部......
So i wanted to have a bottom button so that it shows in all tabs, but i cant seem to make it available at the bottom of every tab screen. I only have the first tab filled with edit text elements and spinners. But the button doesnt show even after setting a scrollview since all elements take more than the screen size. Heres the xml:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<TabHost
android:id="@+id/personalfiletab"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="56dp">
<ScrollView android:id="@+id/ScrollView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableLayout
android:id="@+id/pessoal_tab"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true">
<include android:id="@+id/first" layout="@layout/ecra_editpersonalfile_infoform" />
</TableLayout>
<TableLayout android:id="@+id/morada__contacto_tab"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true">
<include android:id="@+id/first" layout="@layout/ecra_editpersonalfile_moradacontactoform" />
</TableLayout>
<TableLayout
android:id="@+id/profissional_tab"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true">
<include android:id="@+id/first" layout="@layout/ecra_editpersonalfile_infoproform" />
</TableLayout>
<TableLayout
android:id="@+id/documentacao_tab"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true">
<include android:id="@+id/first" layout="@layout/ecra_editpersonalfile_documentacaoform" />
</TableLayout>
</LinearLayout>
</ScrollView>
</FrameLayout>
</LinearLayout>
</TabHost>
<Button
android:text="submit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/submitprofileButton">
</Button>
</LinearLayout>
But the button doesnt show at the bottom of the screen in every tab...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论