反应本机 TextInput 边框不起作用 [英] React native TextInput border not working

查看:51
本文介绍了反应本机 TextInput 边框不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的输入风格:

 searchBarInput: {
  flex: 1,
  fontSize: 20,
  fontWeight: 'bold',
  color: 'white',
  height: 50,
  padding: 0,
  backgroundColor: 'transparent',
  borderColor: '#000000', 
  borderWidth: 50,  
  borderStyle: 'solid',
 }

如果我改变边框宽度,输入的大小会发生变化,但仍然没有可见的边框.

If I change the border width, the size of the input changes, but still there's no visible border.

我在 Android 设备上使用 react-native 0.15.0.

I am using react-native 0.15.0 with an android device.

推荐答案

这是否回答了您的问题:https://github.com/facebook/react-native/blob/master/docs/KnownIssues.md#text-input-border

Does this answer your question : https://github.com/facebook/react-native/blob/master/docs/KnownIssues.md#text-input-border

这似乎是 react-native 的一个已知错误...

It seems it is a known bug from react-native...

您可以尝试将其包裹在视图组件中,并在视图组件上设置您想要的边框.

You can try and wrap it in a view component and set the border you want on the view component.

这篇关于反应本机 TextInput 边框不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆