I'm using this to use as an image gallery.
<android.support.v4.view.ViewPager
android:id="@+id/galeria"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="80dp"
android:layout_alignParentTop="true" />
More is not working when I put it inside a ScrollView
Thisismylayout,thetextdoesnotfitallonthescreeninsomemomentsIneedaScrollView,Iwantedtoputthegalleryinsideittouploadthephotoandthetext,Ijustputitinthetext,itdoesnotlookverygoodbecausesomepeoplewillnottrytouploadonlythetext
I'maddingimageslikethisakinomain
ViewPagergaleria=(ViewPager)findViewById(R.id.galeria);GaleriaImagensAdapteradapter=null;try{adapter=newGaleriaImagensAdapter(this,packageName,id);}catch(SQLExceptione){e.printStackTrace();}galeria.setAdapter(adapter);
andtheadapter
@OverridepublicObjectinstantiateItem(ViewGrouppager,intposition){ImageViewimagem=newImageView(context);imagem.setScaleType(ImageView.ScaleType.CENTER_INSIDE);try{Stringnome_foto=itens.get(position).nome_foto;intdrawableId=context.getResources().getIdentifier(nome_foto,"drawable", packageName);
imagem.setImageResource(drawableId);
}
catch (Exception e) {
Log.e("MyTag", "Failure to get drawable id.", e);
}
((ViewPager) pager).addView(imagem, 0);
return imagem;
}