在layout_width設置為wrap_content的時候,layout_weight所代表的是你的控件要優先盡可能的小,但這個小是有限度的,即wrap_content.
下面来贴几张图,加以说明:
1. layout_width="fill_parent", button1的weight=1,button2的weight=2;
2.layout_width="fill_parent", button1的weight=1,button2的weight=2000;
------------------------------------------------------------------------------------------------------------------------------------------------
3.layout_width="wrap_content", button1的weight=1,button2的weight=2;
4.layout_width="wrap_content", button1的weight=1,button2的weight=2000;
没有评论:
发表评论