K
K
Kirill2018-10-07 15:40:08
Android
Kirill, 2018-10-07 15:40:08

How can a textVIew be programmatically resized?

if (p0.textView?.text == "Item 2")
            p0.textView?.text = "text" // текст устанавливается
if(p0.textView?.text == "Item 3")
            p0.textView?.setBackgroundColor(p0.textView!!.resources.getColor(R.color.colorPrimary)) // цвет тоже меняется
if(p0.textView?.text == "Item 4")
            p0.textView?.height = 256 // а вот размер не меняются.

В чём ошибка?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Chvarkov, 2018-10-08
@KuSu

Resize via the LayoutParams property of the View

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question