So im trying to build chat and the textEdit where you write your message. I want to change height depending on amount of text. a good thing to know also are that this is in a fragment. Like in messenger or normal messaging apps. Kotlin: XML: Answer I fixed it by setting layout params every time the text changed to