<com.google.android.material.card.MaterialCardView android:layout_width="@dimen/base30dp" android:layout_height="@dimen/base30dp" app:cardBackgroundColor="@color/colorWhite" android:layout_alignParentRight="true" app:contentPadding="@dimen/base5dp" app:cardCornerRadius="@dimen/base30dp" android:layout_marginTop="@dimen/base10dp" android:layout_marginRight="@dimen/base10dp" app:cardElevation="0dp"> <TextView android:id="@+id/time_tv" android:layout_width="match_parent" android:layout_height="match_parent" android:text="0" android:gravity="center" android:textSize="@dimen/base10sp" android:textColor="@color/colorBlack" /> </com.google.android.material.card.MaterialCardView>
这个是布局,最后是这样的,简单快捷