我学的是Qt,做的话是两个fram,七个label,两个label和fram等大,做背景,其他的设置下属性位置就好了。属性背景百度一下。
如果是Android的话用framelayout布局,对textview进行align_layout的属性设置就可以
用怪异盒子做这种效果很简单的 定位也是个方法
用RelativeLayout布局,背景自定义一个圆角shape,然后几个TextView调整下布局就可以了
shape
<?xml version="1.0" encoding="utf-8"?>
圆角弧度
填充色
<solid android:color="@color/black"/>
LinearLayout使用权重weight属性实现外层菌粉效果,内部布局可以采用RelativeLayout或者LinearLayout实现
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="100dp">
<RelativeLayout
android:padding="5dp"
android:background="#FF8400"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:layout_centerVertical="true"
android:layout_alignParentStart="true"
android:text="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:text="0.00"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:text="礼券"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
<Space
android:layout_width="20dp"
android:layout_height="wrap_content" />
<RelativeLayout android:padding="5dp"
android:background="#4F8ED8"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="match_parent">
<TextView
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"
android:text="0.00"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:text="VIP卡"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
</LinearLayout>
背景自己写两个圆角shape就行了
RelativeLayout就可以很好地实现你想要的功能;背景颜色加三个TextView的相对位置就能实现其中的任意一个