Android 新消息类型收件人控件
Android New Message type recipient control
请问有人知道如何 replicate/mirror 新消息收件人/收件人栏功能吗?是否有可用的内置控件或小部件,或者我必须自定义构建吗?或者有没有可用的例子?我尝试了几个术语,但不确定我应该使用的确切术语是什么。使用了 "android message recipient bar"、"android message to bar" 等术语,但没有返回对我有用的内容...
仍在建设中,但这是目前的样子....
您可以这样做,marginLeft="-1dp" 只是一种快速解决方案,可以避免创建只有一侧边框的形状。为避免使用这种肮脏的解决方案:How to draw border on just one side of a linear layout?
layout.xml
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:layout_width="wrap_content"
android:layout_height="40dp"
android:text="Able John"
android:textAllCaps="false"
android:background="@drawable/background"
/>
<Button
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="-1dp"
android:background="@drawable/background_right_corners"
/>
</LinearLayout>
drawable/background
<?xml version="1.0" encoding="utf-8"?>
<solid android:color="#fff"/>
<stroke android:width="1dp" android:color="#5000"/>
<corners
android:bottomLeftRadius="5dp"
android:topLeftRadius="5dp"
/>
</shape>
drawable/background_right_corners
<?xml version="1.0" encoding="utf-8"?>
<solid android:color="#fff"/>
<stroke android:width="1dp" android:color="#5000"
/>
<corners
android:bottomRightRadius="5dp"
android:topRightRadius="5dp"
/>
请问有人知道如何 replicate/mirror 新消息收件人/收件人栏功能吗?是否有可用的内置控件或小部件,或者我必须自定义构建吗?或者有没有可用的例子?我尝试了几个术语,但不确定我应该使用的确切术语是什么。使用了 "android message recipient bar"、"android message to bar" 等术语,但没有返回对我有用的内容...
仍在建设中,但这是目前的样子....
您可以这样做,marginLeft="-1dp" 只是一种快速解决方案,可以避免创建只有一侧边框的形状。为避免使用这种肮脏的解决方案:How to draw border on just one side of a linear layout?
layout.xml
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:layout_width="wrap_content"
android:layout_height="40dp"
android:text="Able John"
android:textAllCaps="false"
android:background="@drawable/background"
/>
<Button
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginLeft="-1dp"
android:background="@drawable/background_right_corners"
/>
</LinearLayout>
drawable/background
<?xml version="1.0" encoding="utf-8"?>
<solid android:color="#fff"/>
<stroke android:width="1dp" android:color="#5000"/>
<corners
android:bottomLeftRadius="5dp"
android:topLeftRadius="5dp"
/>
</shape>
drawable/background_right_corners
<?xml version="1.0" encoding="utf-8"?>
<solid android:color="#fff"/>
<stroke android:width="1dp" android:color="#5000"
/>
<corners
android:bottomRightRadius="5dp"
android:topRightRadius="5dp"
/>