android百分比布局
糖醋咸鱼 2017-09-17 09:24:09 <?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/button1"
android:text="button1"
android:layout_gravity="left|top"
app:layout_heightPercent="50%"
app:layout_widthPercent="50%" />
<Button
android:id="@+id/button2"
android:text="button2"
android:layout_gravity="right|top"
app:layout_heightPercent="50%"
app:layout_widthPercent="50%" />
<Button
android:id="@+id/button3"
android:text="button3"
android:layout_gravity="left|bottom"
app:layout_heightPercent="50%"
app:layout_widthPercent="50%" />
</android.support.percent.PercentRelativeLayout>
这样写为什么全部按钮都在左上角?