简体   繁体   English

滚动视图不滚动Android

[英]Scroll view not scrolling android

i tried creating a small game cards game if the first layout the player chooses the character but the screen not big enough to fit all the characters "3" i tried to set scrollview horizontally to fill parent then specific amount then wrap content but i'm getting tired 我尝试创建一个小型游戏纸牌游戏,如果玩家选择了第一个布局,但角色的屏幕不够大,无法容纳所有角色“ 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>

In your <LinearLayout change the line <LinearLayout更改行

...layout_height="350dp" 

to

...layout_height="wrap_content"

Note: And just for good practice, change your width of the <LinearLayout to match_parent . 注意:出于最佳实践,请将<LinearLayout宽度更改为match_parent

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM