title: Xamarin.Android how i can get position and margin to elements which are generated from the code?
body: <p>Problems with position elements which generating from code
  i will try to place it in center and give them margin (left right) from previous elements.
  tried use LinearLayout, RowLayout, but all result are the same (staying center in each other).
  Like a <a href="https://i.stack.imgur.com/YhKhI.png" rel="nofollow noreferrer">Sample</a></p>
  <pre><code>        public void testImageAdd(object sender, EventArgs eventArgs)
          {
  
              RelativeLayout relativeLayout = new RelativeLayout(this);
              RelativeLayout.LayoutParams relativeLayoutParams = new RelativeLayout.LayoutParams(LayoutParams.WrapContent, LayoutParams.WrapContent);
              RelativeLayout.LayoutParams relativeLayoutParams2 = new RelativeLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
              relativeLayoutParams.SetMargins(30,20,30,0);
              relativeLayoutParams.AddRule(LayoutRules.CenterHorizontal);
  
  
  
  
              #region team1 Elements
              ImageView firstTeamLogo = new ImageView(this);
              firstTeamLogo.LayoutParameters = relativeLayoutParams;
  
              TextView firstTeamText = new TextView(this);
              firstTeamText.Text = &quot;testTeam1&quot;;
              firstTeamText.LayoutParameters = relativeLayoutParams;
  
              var firstTeamLogoBitmap = ImageDownloader.GetImageBitmapFromUrl(&quot;&quot;);
              firstTeamLogo.SetImageBitmap(firstTeamLogoBitmap);
              #endregion
  
              #region team2 Elements
              ImageView secondTeamLogo = new ImageView(this);
              secondTeamLogo.LayoutParameters = relativeLayoutParams;
  
              TextView secondTeamText = new TextView(this);
              secondTeamText.Text = &quot;testTeam2&quot;;
              secondTeamText.LayoutParameters = relativeLayoutParams;
  
              var secondTeamLogoTeamLogoBitmap = ImageDownloader.GetImageBitmapFromUrl(&quot;&quot;);
              secondTeamLogo.SetImageBitmap(secondTeamLogoTeamLogoBitmap);
              #endregion
  
              TextView versusText = new TextView(this);
              versusText.Text = &quot;vs&quot;;
              versusText.LayoutParameters = relativeLayoutParams;
  
  
  
  
              relativeLayout.AddView(firstTeamLogo);
              relativeLayout.AddView(firstTeamText);
              relativeLayout.AddView(versusText);
              relativeLayout.AddView(secondTeamText);
              relativeLayout.AddView(secondTeamLogo);
              SetContentView(relativeLayout, relativeLayoutParams2);
  </code></pre>
  <p>What did i do wrong? And i think i'm calling the drawing of elements incorrectly (is there a bit of code duplication?).</p>