通过 layout_weight 属性,一个设置为 3, 一个设置为 7。
需要注意:两个子元素 layout_width 都要改成 0dp。而不是 wrap_content,或是 match_parent。
效果如图: