android – TabHost上的相对布局?

android – TabHost上的相对布局?,第1张

概述我有一个 Android UI问题,我不太清楚如何解决.我有一个tabhost,上面有几个不同的项目.在一种情况下,将动态添加添加到scrollView(位于其中一个选项卡上)的字段.我在屏幕底部有一个按钮,使用相对布局.问题是scrollview(和其他选项卡的线性布局)延伸到底部按钮之外.这导致屏幕上的最终字段是不可查看的,因为它被按钮隐藏.这是问题的屏幕截图以及我的布局的xml.任何帮助是极 我有一个 Android UI问题,我不太清楚如何解决.我有一个tabhost,上面有几个不同的项目.在一种情况下,将动态添加添加到scrollVIEw(位于其中一个选项卡上)的字段.我在屏幕底部有一个按钮,使用相对布局.问题是scrollvIEw(和其他选项卡的线性布局)延伸到底部按钮之外.这导致屏幕上的最终字段是不可查看的,因为它被按钮隐藏.这是问题的屏幕截图以及我的布局的xml.任何帮助是极大的赞赏.

主要布局:

<?xml version="1.0" enCoding="utf-8"?><TabHost xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:ID="@androID:ID/tabhost"    androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent"    androID:background="@drawable/background_nologo" ><linearLayout     androID:orIEntation="vertical"    androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent"    androID:padding="5dp" ><TabWidget androID:ID="@androID:ID/tabs"    androID:layout_wIDth="fill_parent"    androID:layout_height="wrap_content"    androID:layout_alignParenttop="true" /><VIEw androID:layout_wIDth="fill_parent"    androID:layout_height="2dip"/><FrameLayout    androID:ID="@androID:ID/tabcontent"    androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent"><include layout="@layout/mc_message_send_tab_details"/><!-- ScrollvIEw for message data --><ScrollVIEw androID:layout_wIDth="fill_parent"     androID:layout_height="fill_parent"    androID:scrollbars="vertical"    androID:ID="@+ID/formTab"><!-- Form fIElds are automatically     created in McmessageVIEwActivity. --><linearLayout androID:ID="@+ID/formlayout"    androID:layout_wIDth="fill_parent"    androID:layout_height="wrap_content"    androID:orIEntation="vertical" >    <VIEw androID:layout_wIDth="fill_parent"    androID:layout_height="5dip"/></linearLayout></ScrollVIEw></FrameLayout></linearLayout><relativeLayout androID:orIEntation="vertical"    androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent">      <linearLayout androID:layout_height="wrap_content"    androID:layout_wIDth="fill_parent"    androID:layout_alignParentBottom="true" >    <button androID:text="Send"         androID:ID="@+ID/btnSend" androID:layout_weight="1"         androID:layout_height="wrap_content" androID:layout_wIDth="0px"/></linearLayout></relativeLayout></TabHost>

附加标签布局:

<linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:layout_wIDth="fill_parent"     androID:layout_height="fill_parent"    androID:ID="@+ID/detailsTab">    <tableLayout androID:layout_wIDth="fill_parent"       androID:layout_height="fill_parent"       androID:stretchColumns="1">        <VIEw androID:layout_wIDth="fill_parent"            androID:layout_height="10dip"/>       <tableRow>           <TextVIEw               androID:text="Unit #"               androID:textStyle="bold"               androID:gravity="right"               androID:padding="3dip" />           <Spinner androID:ID="@+ID/unitNumber"               androID:text=""               androID:padding="3dip"               androID:layout_marginRight="2sp"/>       </tableRow>       <tableRow>           <TextVIEw               androID:text="User ID"               androID:textStyle="bold"               androID:gravity="right"               androID:padding="3dip" />           <EditText androID:ID="@+ID/userID"               androID:text=""               androID:padding="3dip"               androID:layout_marginRight="2sp" />       </tableRow>       <tableRow>           <TextVIEw               androID:text="Form #"               androID:textStyle="bold"               androID:gravity="right"               androID:padding="3dip" />           <Spinner androID:ID="@+ID/formNumber"               androID:text=""               androID:padding="3dip"               androID:layout_marginRight="2sp" />       </tableRow>       <tableRow>           <TextVIEw               androID:text="Sending status"               androID:textStyle="bold"               androID:gravity="right"               androID:padding="3dip" />           <EditText androID:ID="@+ID/sendingStatus"               androID:text=""               androID:padding="3dip"               androID:layout_marginRight="2sp"/>       </tableRow>       <tableRow>           <TextVIEw               androID:text="Delivery priority"               androID:textStyle="bold"               androID:gravity="right"               androID:padding="3dip" />           <EditText androID:ID="@+ID/priority"               androID:text=""               androID:padding="3dip"               androID:layout_marginRight="2sp"/>       </tableRow>       <tableRow>           <TextVIEw               androID:text="Request reply"               androID:textStyle="bold"               androID:gravity="right"               androID:padding="3dip" />           <CheckBox androID:ID="@+ID/requestReply"               androID:padding="3dip"               androID:layout_marginRight="2sp" />       </tableRow>       <tableRow>           <TextVIEw               androID:text="Receipt conf"               androID:textStyle="bold"               androID:gravity="right"               androID:padding="3dip" />           <CheckBox androID:ID="@+ID/receiptConfirmation"               androID:padding="3dip"               androID:layout_marginRight="2sp" />       </tableRow>    </tableLayout>   </linearLayout>
解决方法 您的主要问题是由于TabHost扩展了FrameLayout.这就是你在主布局上使用最后一个relativeLayout的原因.你试图欺骗,你输了…… 总结

以上是内存溢出为你收集整理的android – TabHost上的相对布局?全部内容,希望文章能够帮你解决android – TabHost上的相对布局?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1121841.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存