How to set a maximum height with wrap content in android?

前端 未结 7 2201
你的背包
你的背包 2020-12-09 02:01

In android, how can you create a scroll view that\'s got a max height, and wrap contents, basically it wraps the content vertically, but has a maximum height?

I trie

相关标签:
7条回答
  • 2020-12-09 02:48

    Here you can set height of your Scrollview like this -:

    <ScrollView 
     android:id="@+id/scrollView1"
     android:layout_width="match_parent"
     android:layout_height="200dp"
     android:layout_alignParentBottom="true" >
    
               <LinearLayout
                android:id="@+id/maincontainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
    
               </LinearLayout>
    </ScrollView>
    
    0 讨论(0)
提交回复
热议问题