1

I want to make a Textarea with multiline. So if I set the height of the field to 100 then the placeholder and input text is centered and not at the top.

I want it that the text begin at the top.

 <View style={{flex: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', marginTop: 50}}> <AntDesign name="infocirlceo" size={24} style={{backgroundColor: '#fff', padding: 10, borderRadius: 100, marginRight: 12}} color="#555" /> <TextInput style={{padding: 10, height: 100, backgroundColor: '#fff', borderWidth: 1, width: 250, borderRadius: 8, borderColor: '#eee'}} placeholder="Proudktbeschreibung eingeben" multiline numberOfLines={1} /> </View> 

enter image description here

3
  • What have you tried changing, and to what effect? Commented Jul 14, 2021 at 11:17
  • 2
    try textAlignVertical: 'top' in style Commented Jul 14, 2021 at 11:18
  • 1
    "Produktbeschreibung" just a hint u have a typo Commented Jul 14, 2021 at 11:18

1 Answer 1

1

I think AntDesign is what's causing the issue and since you haven't shown any of the code of that component I can't tell you exactly what's wrong. But what I can show you is how you can achieve the look you are going for.

In this example I used an image inside a view instead of your AntDesign. And here is the end result (used a different image because I don't have yours)

End result

In Order to achieve that this is the code I have written

<View style={{ flex: 1, flexDirection: 'row', alignItems: 'center', justifyContent: 'center', marginTop: 50 }}> <View style={{ padding: 15, backgroundColor: '#fff',margin:10,borderRadius:100 }}> <Image style={{ height: 30, width: 30 }} source={require("../../../../assets/icons/capture.png")} /> </View> <TextInput style={{ padding: 10, height: 100, backgroundColor: '#fff', borderWidth: 1, width: 250, borderRadius: 8, borderColor: '#eee' }} placeholder="Proudktbeschreibung eingeben" multiline numberOfLines={1} /> </View> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.