title: How to set imageButton to top left corner of a subview (webview) in Android
body: <p>I'm having trouble on setting the imageButton to top, left corner of my WebView, i have no idea on how to play with layouts (linear or relative), i tried lots of code blocks and none of them worked for me.</p>
  
  <p>This is how i create my imageButton;</p>
  
  <pre><code>ImageButton mImageButton = new ImageButton(context);
          mImageButton.setImageResource(R.drawable.close_button);
          mImageButton.setLayoutParams(new ViewGroup.LayoutParams(width, height));
          mImageButton.setAdjustViewBounds(true);
          mImageButton.setBackgroundDrawable(null);
          mImageButton.setScaleType(ImageView.ScaleType.FIT_CENTER);
  </code></pre>
  
  <p>and this is how i create and add my imagebutton to webview</p>
  
  <pre><code>        WebView mWebView = new WebView(context);
          mWebView.loadData(htmlContent, "text/html", "UTF-8");
          mWebView.addView(mImageButton);
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/cK7zQ.jpg" rel="nofollow">This is how it looks like</a></p>
  
  <p>any idea on how can i place it correctly without using xml, since i'm trying to do this for a jar file that will be distrbuted</p>