/*
* A structure describing general information about a display, such as
* its size, density, and font scaling.To access the DisplayMetrics
* members, initialize an object like this:
*/
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
Gallery g = (Gallery) findViewById(R.id.gallery);
// set gallery to left side
MarginLayoutParams mlp = (MarginLayoutParams) g.getLayoutParams();
mlp.setMargins(-(metrics.widthPixels / 2 + (imageWidth/2)), mlp.topMargin,
mlp.rightMargin, mlp.bottomMargin);
Learn about the Android Development and how it can be used to create mobile and non-mobile applications.This website give full tutorials for develop android application and it is absolutely free.
Showing posts with label Android Gallery. Show all posts
Showing posts with label Android Gallery. Show all posts
Tuesday, March 13, 2012
How to set gallery starts from left corner?
Subscribe to:
Posts (Atom)
