开发者

How adjust Android listview column width at runtime?

开发者 https://www.devze.com 2022-12-15 14:58 出处:网络
Does the Android listview has a method to ach开发者_运维百科ieve this goal? I would like to implement the function like listview in C# or vb. There users can adjust the

Does the Android listview has a method to ach开发者_运维百科ieve this goal?

I would like to implement the function like listview in C# or vb. There users can adjust the column width by themselves.


I don't believe you can specifically set the width on a ListView element. That kinda defeats the purpose of Android's layout system. Similar to WPF, Android lays out its UI's in a fluid and dynamic way so that it can intelligently lay out all the children within a View based on their relationships. That's why views are added to layout containers. Maybe if you describe what it is you're trying to do, there might be a more Android-like solution than explicitly setting the width after the view has already been drawn or measured.

Here's a good link to read when thinking about Android layouts and views:

How Android Draws Views

0

精彩评论

暂无评论...
验证码 换一张
取 消