如何在Xamarin Andriod中制作Material Design Filled文本字段

时间:2019-04-03 11:54:48

标签: xamarin.android material-design material-ui

我想在Xamarin andriod中使用材质设计Filled TextField。浮动标签正在工作Accurate,但我想使背景颜色像Give Image。 Dint知道我如何使用Material设计的@style来制作这样的文本字段。

This Is The Required OutPut of Material design

这是我用来实现它的代码:

<!-- <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>

1 个答案:

答案 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>