title: how to center an image inside a scrollview and horizontal scroll view android
body: <p>im loading a large image into an imageview using picasso but i want it to sit in the center of the view but right now it alligns with the start (top left corner) ive tried alsorts via xml with no success, the image view is inside a scrollview and a horizontal scrollview like this</p>
  
  <pre><code>  &lt;RelativeLayout
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:id="@+id/scrollcontainer"&gt;
  
          &lt;HorizontalScrollView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:id="@+id/upydownyscrolleyscrolley"&gt;
  
              &lt;ScrollView
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:id="@+id/leftyrightyscrolleyscrolley"
                  &gt;
                  &lt;LinearLayout
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:orientation="horizontal"
                      android:id="@+id/imagecontainer"&gt;
  
                  &lt;ImageView
                      android:id="@+id/wallImage"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content" /&gt;
  
                  &lt;/LinearLayout&gt;
  
              &lt;/ScrollView&gt;
          &lt;/HorizontalScrollView&gt;
      &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>some images are too big for the screen horizontally and some are too big vertically so i came across a way to achieve it programmatically but it isnt working ive tried using the width and height of the scrollviews, which didnt work so i tried getting the height and width of the image view like this,</p>
  
  <pre><code>int centerX = WallpaperView.getWidth()/2;
  int centerY = WallpaperView.getHeight()/2;
  scrollView.scrollTo(centerX, centerY);
  </code></pre>
  
  <p>but again no joy, i dont know if this is because picasso hasnt loaded the view yet, although i am calling it after calling picasso is there anyone who can help me?</p>