Friday, July 5, 2013

[android help] Set Icons over Imageviews(inside frameLayout)


Set Icons over Imageviews(inside frameLayout)



I am new to android.I have a question that i am trying to put icons over the FrameLayout. enter image description here


Now,all the four colored triangular Boxes are the ImageViews in the different four FrameLayouts and all the four Frame Layouts are inside a RelativeLayout.


Now I want to put the icons over the 4 FrameLayouts.I am making these layouts in jaa not in XML. So,I am not able to put these icons over the particular ImageView(framelayout); I am using this code to set the position of icons over the particular frame or imageview,



ImageView icon = new ImageView(getBaseContext());
icon.setImageResource(R.drawable.wordpress_icon);
LayoutParams paramsIcon = new LayoutParams(50, 50);
MarginLayoutParams IconPara = new MarginLayoutParams(50,50);
// IconPara.setMargins(500, 500, 0, 0);
//icon.setPadding(0, 0, width-60, height-60);
icon.layout(50, 50, 0, 0);
icon.requestLayout();
icon.setLayoutParams(paramsIcon);


But after all , I am not able to put these icons over the specific place on the screen.



.

stackoverflow.comm



No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...