如何使用xml布局在图片所示的文字周围添加边框
我尝试将边框添加到布局中,但与文本重叠。
您可以使用形状可绘制
将textviews背景设置为白色,然后将其放在框上方
能否请您详细说明一下,我必须在该矩形内添加textviews
这回答了你的问题了吗? 如何在Android textview周围放置边框?
您可以尝试这种布局,它可以根据您的要求进行反映
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/border"
android:layout_marginTop="10dp"
android:orientation="vertical"
android:padding="15dp">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="Label 1: Value 1"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="Label 2: Value 2"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="Label 3: Value 3"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content"