gpt4 book ai didi

java - ScrollView 不滚动android

转载 作者:行者123 更新时间:2023-12-01 13:47:01 25 4
gpt4 key购买 nike

如果玩家选择角色的第一个布局,我尝试创建一个小型游戏纸牌游戏但屏幕不够大,无法容纳所有字符“3”,我尝试水平设置 ScrollView 以填充父项,然后填充特定数量,然后换行内容,但我累了

    <ScrollView
android:layout_marginTop="35dp"
android:layout_width="650dp"
android:layout_height="wrap_content"
>

<LinearLayout
android:layout_marginTop="40dp"
android:layout_width="650dp"
android:layout_height="350dp"
>


<RadioGroup

android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/RBarthu_mage"
android:button="@drawable/user_arthu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

<RadioButton
android:id="@+id/RBDwemer_fighter"
android:button="@drawable/xuser_dwemer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
/>
<RadioButton
android:id="@+id/RBZombie"
android:button="@drawable/xuser_zombie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
/>

</RadioGroup>
</LinearLayout>


</ScrollView>

最佳答案

在您的 <LinearLayout 中换行

...layout_height="350dp" 

...layout_height="wrap_content"

注意:为了良好的实践,请更改 <LinearLayout 的宽度至match_parent

关于java - ScrollView 不滚动android,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20291652/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com