一旦微调器有条目,布局就会混乱
我有
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayoutPlayer"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Spinner
android:id="@+id/Spinner01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="100" />
<ToggleButton
android:text="@+id/ToggleButton01"
android:id="@+id/ToggleButton01"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1" />
</LinearLayout>
它显示一个 spinner
和它旁边的一个 ToggleButton
。到目前为止一切都还好。当然,spinner
需要一些条目,因此我向微调器添加了以下属性:
android:entries="@array/myentries"
现在的问题是 ToggleButton
比微调器和按钮要低一些。 ToggleButton
被切断,可能有 3 或 5 行像素。
有人知道这里出了什么问题吗? Android 版本是 2.2
谢谢!
I have
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayoutPlayer"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<Spinner
android:id="@+id/Spinner01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="100" />
<ToggleButton
android:text="@+id/ToggleButton01"
android:id="@+id/ToggleButton01"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_weight="1" />
</LinearLayout>
Which displays a spinner
and a next to its a ToggleButton
. Everything okay so far. Of course the spinner
need some entries, so I add to the spinner the attribute:
android:entries="@array/myentries"
The problem now is that the ToggleButton
is a bit lower than the spinner and the button of the ToggleButton
is cut off, maybe 3 or 5 lines of pixels.
Anyone an idea what is wrong here? Android is version 2.2
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将您的
ToggleButton
包装在新的LinearLayout
中。那么你的 xml 将是:Try wrapping your
ToggleButton
in a newLinearLayout
. Your xml would then be: