Good afternoon guys, this time I would like to collaborate with a process that I do and it is to take (n) number of photos and put them dynamically in a LinearLayout, the problem is that, when I add them, there is a wide space between each item in this way:
Normal form, before taking picture:
This is the Java code of my process:
public void TomarFoto(View view){
nombre_imagen = GetNombre();
Intent intento1 = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File foto = new File(getExternalFilesDir(null), nombre_imagen + ".jpg");
intento1.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(foto));
startActivityForResult(intento1, TAKE_PICTURE);
}
And this is the XML where the images are added:
<LinearLayout
android:id="@+id/Fotografias"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:text="Tomar Foto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="27dp"
android:id="@+id/BtnTomarFoto"
style="@style/Widget.AppCompat.Button.Colored"
android:onClick="TomarFoto"/>
</LinearLayout>
</ScrollView>
I appreciate your collaboration!