Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Can we add an ImageView inside a linear Layout?

Hi All,
I am trying to add an Image view inside a LinearLayout in Xamarin.android from code but it's giving run-time error like multiple parent of a child,So first remove the view then add.
What Wrong I am doing any help will be appreciated.
****Code snippet:****
LinearLayout outerLayout=new Linearlayout(Context);
ImageView imageView=new ImageView(Context);
imageView.setWidth(800);
Button add=new Button(Context);
Button delete=new Button(Context);
LinearLayout InnerLayout=new Linearlayout(Context);
innerlayout.addView(imageView);
innerlayout.addView(add);
innerlayout.addView(delete);

outerLayout.addView(innerlayout);

Answers

Sign In or Register to comment.