3 回答
TA贡献2011条经验 获得超2个赞
选项1:形状可绘制
drawable
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <solid android:color="#8fff93" /> <stroke android:width="1px" android:color="#000" /></shape>
solid
background="@drawable/your_shape_drawable"
备选案文2:背景视图
RelativeLayout
BorderView
<View android:id="@+id/border" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignBottom="@+id/image" android:layout_alignLeft="@+id/image" android:layout_alignRight="@+id/image" android:layout_alignTop="@+id/main_image" android:background="#000" /><ImageView android:id="@+id/image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_... android:padding="1px" android:src="@drawable/..." />
adjustViewBounds=true
RelativeLayout
RelativeLayout
View
Shape
备选方案3:9-补丁
android:background="@drawable/..."
Shape
备选方案4:额外视图
LinearLayout
View
<View android:background="#000" android:layout_width="match_parent" android:layout_height="1px"/>
- 3 回答
- 0 关注
- 300 浏览
添加回答
举报