android– 彼此相邻的两个旋转器

android– 彼此相邻的两个旋转器,第1张

概述当我把两个旋转器放在一起时,我遇到了这个问题.这是布局xml的片段:...<LinearLayoutandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:orientation="horizontal"android:weightSum="2"><S

当我把两个旋转器放在一起时,我遇到了这个问题.这是布局xml的片段:

...<linearLayout    androID:layout_wIDth="fill_parent"    androID:layout_height="wrap_content"    androID:orIEntation="horizontal"    androID:weightSum="2" >    <Spinner        androID:ID="@+ID/x"        androID:layout_wIDth="fill_parent"        androID:layout_height="wrap_content"        androID:layout_gravity="top|left"        androID:layout_weight="1" />    <Spinner        androID:ID="@+ID/y"        androID:layout_wIDth="fill_parent"        androID:layout_height="wrap_content"        androID:layout_gravity="top|right"        androID:layout_weight="1" /></linearLayout><relativeLayout androID:layout_wIDth="fill_parent" androID:layout_height="wrap_content">    <ListVIEw        androID:ID="@+ID/z"        androID:layout_wIDth="fill_parent"        androID:layout_height="fill_parent"        androID:cachecolorHint="#FFFFFF" >    </ListVIEw>......

结果如下:

我尝试了很多不同的东西.我试过改变权重,重力,将父改变为relativeLayout,但结果保持不变.

请帮忙!

编辑:

好.我知道了.一些冗余,但它解决了这个问题.有点奇怪为什么这个工作和“正常的方式”没有.感谢大家的帮助.

<linearLayout    androID:layout_wIDth="fill_parent"    androID:layout_height="wrap_content"    androID:orIEntation="horizontal"    androID:weightSum="2" >    <Spinner        androID:ID="@+ID/x"        androID:layout_wIDth="0dip"        androID:layout_height="wrap_content"        androID:layout_weight="1" />    <relativeLayout        androID:layout_wIDth="0dip"        androID:layout_height="fill_parent"        androID:layout_weight="1" >        <Spinner            androID:ID="@+ID/y"            androID:layout_wIDth="fill_parent"            androID:layout_height="wrap_content"            androID:layout_alignParenttop="true" />    </relativeLayout></linearLayout>

解决方法:

这对我来说很好:

<linearLayout    androID:ID="@+ID/x"    androID:layout_wIDth="fill_parent"    androID:layout_height="wrap_content"    androID:orIEntation="horizontal"    androID:weightSum="2">    <Spinner        androID:ID="@+ID/s1"        androID:layout_wIDth="0dip"        androID:layout_height="wrap_content"        androID:layout_weight="1" />    <Spinner        androID:ID="@+ID/s2"        androID:layout_wIDth="0dip"        androID:layout_height="wrap_content"        androID:layout_weight="1" /></linearLayout>
总结

以上是内存溢出为你收集整理的android – 彼此相邻的两个旋转器全部内容,希望文章能够帮你解决android – 彼此相邻的两个旋转器所遇到的程序开发问题。

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

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

原文地址: http://outofmemory.cn/web/1105588.html

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

发表评论

登录后才能评论

评论列表(0条)

保存