我想在Xamarin andriod中使用材质设计Filled TextField。浮动标签正在工作Accurate,但我想使背景颜色像Give Image。 Dint知道我如何使用Material设计的@style来制作这样的文本字段。
这是我用来实现它的代码:
<!-- <item> -->
<!-- <shape android:shape="rectangle"> -->
<!-- 1 Draw a 2dp width border around shape @1@ -->
<!-- <stroke -->
<!-- android:color="#004d40" -->
<!-- android:width="2dp" --> <!-- /> -->
<!-- </shape> -->
<!-- </item> -->
<!-- Overlap the left, top and right border using background color -->
<item android:bottom="7dp">
<shape android:shape="rectangle">
<solid android:color="#F8F9FA"/>
</shape>
</item>
</layer-list>
答案 0 :(得分:0)
<?xml version="1.0" encoding="utf-8" ?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- <item> -->
<!-- <shape android:shape="rectangle"> -->
<!-- 1 Draw a 2dp width border around shape @1@ -->
<!-- <stroke -->
<!-- android:color="#004d40" -->
<!-- android:width="2dp" -->
<!-- /> -->
<!-- </shape> -->
<!-- </item> -->
<!-- Overlap the left, top and right border using background color -->
<item
android:bottom="7dp">
<shape android:shape="rectangle">
<solid android:color="#F8F9FA"/>
</shape>
</item>
</layer-list>