could help me telling me some or some ways to imitate a HorizontalScrollView , since I implemented one and I put buttons in it, but when I run the app (on the cell phone) it gets a lot stuck, I tried it on other cell phones but the same thing happens, I do not understand why, or maybe I did something wrong to implement it. The images for the buttons I have in the drawable I do not know if that affects something.
Java Code:
peliculas = (LinearLayout) findViewById(R.id.layoutPeliculas);
LinearLayout contenedorPeliculas = new LinearLayout(this);
contenedorPeliculas.setLayoutParams(new LinearLayput.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.WRAP_CONTENT));
for (int i = 0; i < listaPeliculas.size(); i++ )
{
ImageView pelicula = new ImageView(this);
pelicula.setLayoutParams(new LinearLayout.LayoutParams(210,290));
pelicula.setBackgroundResource(listaPeliculas.get(i).Fondo());
pelicula.setId(i);
pelicula.setOnClickListener(this);
contenedorPeliculas.addView(pelicula);
}
peliculas.addView(contenedorPeliculas);
XML Code:
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/layoutPeliculas"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="horizontal">
</LinearLayout>
</HorizontalScrollView>