小编Mig*_*rti的帖子

无法弄清楚如何正确使用 KeyboardAvoidingView

我正在使用 React Native 开发一个应用程序,我们有设计师制作的屏幕布局。但我无法正确实现预期的行为。基本上它是一个带有一些文本输入和一个按钮的屏幕,我需要在键盘出现时正确调整的东西。以下是预期的屏幕:

\n

不带键盘\n带键盘

\n

因此,当键盘出现时,按钮必须向上移动很多,两个文本输入都会向上移动一点,并且顶部的文本保持不变。没有键盘时屏幕看起来很完美,但现在键盘出现时它什么也不做。我尝试了很多东西,但没有任何效果。现在是渲染方法:

\n
render() {\n    const textInputBorderColor = this.state.hasError ? Colors.error : Colors.background;\n    const textInputCpfMarginTop = this.state.hasError ? 24 : 48;\n\n    return (\n        <View style = {styles.container}>\n            <KeyboardAvoidingView behavior=\'padding\'>\n                <Text style = {styles.headerText}>Vamos come\xc3\xa7ar!</Text>\n                \n                <TextInput \n                    value = {this.props.user.name} \n            onChangeText = {text => this.props.user.name = text}\n                    placeholder = \'Insira aqui seu nome completo\'\n                    style = {[styles.textInputName, {borderColor: textInputBorderColor}]}\n                />\n\n                <ErrorText show = {this.state.hasError} value = {this.state.errorMsg}/>\n\n                <TextInputMask\n                    value = {this.props.user.cpf}\n                    onChangeText = …
Run Code Online (Sandbox Code Playgroud)

keyboard jsx react-native

6
推荐指数
1
解决办法
5726
查看次数

如何在iTextPDF中对齐图形?

我正在开发一个Java App.我使用jFreeChart创建了一个饼图,并将其添加到使用iText库创建的PDF文件中,但我无法找到一种方法来对齐PDF中的图形并使其居中.这是我用来添加图表的代码:

PdfContentByte contentByte = writer.getDirectContent();

PdfTemplate template = contentByte.createTemplate(600, 600);
Graphics2D graphics2d = template.createGraphics(600, 600, new DefaultFontMapper());
Rectangle2D rectangle2d = new Rectangle2D.Double(0, 0, 300, 300);

resultsPieChart.draw(graphics2d, rectangle2d);

graphics2d.dispose();
contentByte.addTemplate(template, 0, 0);
Run Code Online (Sandbox Code Playgroud)

java pdf alignment jfreechart itext

5
推荐指数
1
解决办法
719
查看次数

标签 统计

alignment ×1

itext ×1

java ×1

jfreechart ×1

jsx ×1

keyboard ×1

pdf ×1

react-native ×1