2016-05-18 9 views
0

私は3つのImageViewをお互いの上に置いています。しかし、画面の解像度または親のImageViewのサイズが変更された場合、子供ImageViewの位置は元の位置を保持します。これらの古い位置は新しい親のために間違っていますImageViewサイズ。新しいポジションはどのように計算できますか?あるいは、この問題を解決する別の方法がありますか?ダミーの上にイメージビュー上のイメージビュー

すべての画像は、私の仕事のこのスクリーンショットでImageViewです:

Every parent image on dummy an imageview in this screenshot.

答えて

0

私は絶対的なレイアウトを使用し、それは私のための仕事です。ここにコードの例を示します。

 <AbsoluteLayout 
      android:orientation="vertical" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="1" 
      android:id="@+id/save" 
      android:nestedScrollingEnabled="true" 
      android:background="#eeeeee"> 

      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="400dp" 
       android:id="@+id/imageView" 
       android:src="@drawable/dummy2" 
       android:layout_alignParentLeft="true" 
       android:layout_marginLeft="30dp" 
       android:layout_alignParentTop="true" 
       android:layout_marginTop="0dp" 
       android:scaleType="fitStart" 
       android:layout_y="20dp" 
       android:layout_x="30dp" /> 


      <ImageView 
       android:layout_width="166dp" 
       android:layout_height="200dp" 
       android:id="@+id/k_altkiy_v" 
       android:layout_x="-2dp" 
       android:layout_y="170dp" /> 

      <ImageView 
       android:layout_width="120dp" 
       android:layout_height="200dp" 
       android:id="@+id/k_ustkiy_v" 
       android:layout_marginTop="85dp" 
       android:layout_alignParentTop="true" 
       android:adjustViewBounds="false" 
       android:scaleType="fitStart" 
       android:layout_x="28dp" 
       android:layout_y="66dp" /> 


      <ImageView 
       android:layout_width="128dp" 
       android:layout_height="200dp" 
       android:id="@+id/k_cek_v" 
       android:layout_x="16dp" 
       android:layout_y="50dp" /> 

     </AbsoluteLayout> 
+0

私はそれはすでに廃止されましたとして ''を使用することが推奨されていること、そう思ういけない。@エムレエロール –

+0

MaulikM.Dodia @は何で廃止予定?今はうまくいきます。それが非難されている場合、解決策は何ですか? –

+0

実際、私は今は解決策がありません。私が見つけたら、私はあなたに戻ってきます。しかし、** IMHO **廃止された**メソッド**を使用することはお勧めできません。**その他の古いタグ**および** Google **にも代替手段があります。@ Emre Erol –

関連する問題