I have the following layout:
<HorizontalScrollView
android:id="@+id/scrollableContents"
android:layout_above="@id/getting_started_buttons_container"
android:layout_below="@id/getting_started_title_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<FrameLayout
android:id="@+id/getting_started_keywords_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white">
</FrameLayout>
</HorizontalScrollView>
In which i dynamically add views using a for loop in a container, i,m using translation to move them to right
index = 0;
for (Word word : wordList) { //wordList size is 15 or more
index++;
view = new MyView(this, null);
view.setTranslationX(index * 150);
container.addView(view);
container.invalidate();
scrollView.requestLayout();
scrollView.invalidate();
}
My scrollView does not extend over the screen since it has the initial empty view. I need to see all views. Can anybody help me? I need a way to update scrollView to a width that contains all my elements
EDIT: I want to achieve something like these with a dynamically number of circles, which must extend in scrollView if there is no room on the screen. LinearLayout is not a solution....
