我正在使用带有样式组件的 React Native Web 和 React Native Paper 库。基本上我想自定义 TextInput 内部组件:标签和html 输入
问题是:
1)如何更改标签样式?例如。宽度\尺寸\颜色等?
2)如何更改html输入样式?
我想设置outline: none
以防止在浏览器的情况下蓝色边框显示在焦点上。我知道,在我们没有原生的情况下,原html
生网络会对其进行编译。
而且我无法理解如何捕获嵌套标签组件来更改其样式。因为我想在未填充时显示灰色标签,在填充时显示紫色并且输入文本应该是black。在网络的情况下,这是微不足道的,但在原生的情况下,我不知道如何处理它。
那有可能吗?
谢谢你的帮助。这是代码示例
import React from 'react';
import {
View,
Platform,
} from 'react-native';
import {
TextInput as NativePaperInput,
withTheme,
} from 'react-native-paper';
import styled from 'styled-components/native';
const NativePaperInputThemed = withTheme(NativePaperInput);
export const TextInputStyled = styled(NativePaperInputThemed)`
${(props: any) => {
return `
outline: none; // doesn't work
input: { outline: none; } // doesn't work
& input: { outline: none; } // doesn't work
// Label change style ?
color: ${props.theme.theme10x.palette.typography.placeholder}; // doesn't work
border-color: '#f92a2a8a'; // doesn't work
height: 52px;
`;
}
}
`;
PS 基本上,即使颜色和 fontFamily 也无法正常工作