I've a big problem I'm trying to add an Imageview programmatically but I face a strange problem:
I've put in the XML just an empty Relative Layout matching the parent. Code wise I'm adding an imageview to the relative layout.
Everything works, the imageview is visible and sized correctly, but the problem is that the "0,0" position is weird. It seems that it has a Top Margin while instead the Left Margin is correctly 0. Also forcing the position to "0,0" with SetX/SetY results with this wierd top border:
Image:
Code:
base_layout = (RelativeLayout) findVieById(R.id.base_layout);
image_logo = New Imageview(this);
base_layout.AddView(image_logo);
image_logo.SetPadding(0,0,0,0);
image_logo.SetX(0);
image_logo.SetY(0);
image_logo.SetImageResource(R.drawable.generic_image);
image_logo.SetVisibility(View.VISIBLE);
I don't understand why..the activity in the manifest has its usual Theme.NoTitleBar.Fullscreen flag.
Any help? It will be really appreciated!