Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以基本上我有一个按钮,而不是将它放在屏幕的中心(水平)我希望它有点偏离,它的左角从中心开始。从一侧硬编码边距不是一种选择。有没有办法做到这一点?
将 aView和 aButton放在水平线性布局中,并赋予layout_weight两者相等View和Button,按钮左角将从中心开始
View
Button
layout_weight