D
D
Dmitry Richter2014-07-02 02:33:06
Java
Dmitry Richter, 2014-07-02 02:33:06

How to attach the next element to the end of the image?

The bottom line is that I needed to attach the next element (TabHost) to the picture (ImageView). More precisely, to the bottom of my picture, attach the top of the tab host. The picture parameters are:

<ImageView
            android:layout_width="match_parent"
            android:layout_height="264dp"
            android:id="@+id/imageView"
            android:layout_gravity="center_horizontal|top"
            android:src="@drawable/top"
            android:scaleType="fitXY" />

Parameters on the tabhost:
<TabHost
            android:layout_width="fill_parent"
            android:layout_height="220dp"
            android:id="@+id/tabHost"
            android:layout_gravity="center_horizontal|bottom">

I also tried to write something like this in onCreate:
ImageView top = (ImageView) findViewById(R.id.imageView);
        int height = top.getHeight();
 TabHost host = (TabHost) findViewById(R.id.tabHost);
        host.setup();
        host.setMinimumHeight(height);

Please help with something.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bimeg, 2014-07-02
@followthemoney

<RelativeLayout ...>

  <ImageView android:id="@+id/image" ... />

  <TabHost android:layout_below="@id/image"  ...>
                ...
  </TabHost>

</RelativeLayout>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question