How can I add elements in ScrollView programmatically, and not in the visual editor previously?

    1 answer 1

    1. Do not use the visual editor - it is buggy, make markup through xml
    2. To add something programmatically in ScrollView, you must first find its only descendant, and then add views to it:

       ScrollView sv = ...; ViewGroup innerView = sv.getChildAt(0); //Создаём новую View TextView tv = new TextView(context); tv.setText("New View"); innerView.addView(tv);