首页 文章

NativeScript圆形输入?

提问于
浏览
0

我正在尝试使用NativeScript和Angular创建一个应用程序,并希望我的文本输入框有这样的圆角:

enter image description here

目前,这是它的外观:
enter image description here

这是我的HTML:

<TextField style="margin-top: 20;" class="input-rounded" hint="Email Address" keyboardType="email" returnKeyType="next" autocorrect="false" autocapitalizationType="none"></TextField>

然后这是我的.css:

TextField {
  border-width: 1;
  border-color: white;
  background-color: white;
  height: 7%;
  width: 90%;
  margin-bottom: 20;
}

我也尝试将边框半径设置为1rem . 谢谢!

1 回答

  • 2

    请尝试仅提供 border-radius

    .input-rounded {
      margin-top: 20;
      border-width: 1;
      border-color: white;
      background-color: white;
      margin-bottom: 20px;
      border-radius:10;
    }
    
    <TextField class="input-rounded" hint="Email Address" keyboardType="email" returnKeyType="next" autocorrect="false" autocapitalizationType="none"></TextField>
    

    编辑:修改代码 . 删除了内联样式标记,并使用类而不是元素选择器添加了css .

相关问题