在我的布局中,有ProgressBar
和
android:layout_width="30dp"
android:layout_height="30dp"
未设置margins
或paddings
。
但是ProgressBar
并没有占据整个边界框,圆周围存在奇怪的间隙。
如何使ProgressButton
符合指定的尺寸?
答案 0 :(得分:0)
您可以使用android:clipChildren="false"
使其在父对象上溢出
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="50dp"
android:background="@color/colorPrimary"
android:gravity="center_horizontal"
android:orientation="vertical">
<ProgressBar
android:layout_width="390dp"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="55dp"
android:layout_marginRight="50dp" />
</LinearLayout>
</RelativeLayout>