/*
* 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.
Tuesday, March 13, 2012
How to set gallery starts from left corner?
Subscribe to:
Post Comments (Atom)

1 comment:
hey that code not working properly.try to corrupt mistakes
Post a Comment