2016-03-26 18 views
0

私は相対レイアウト上にイメージビューを持っています。 あなたはスクリーンショットで見ることができます:enter image description here はどのように私は以下の画像のように、右下の隅にImageViewの(WEEL)を移動し、それのわずか25%の部分を表示することができます。 enter image description hereイメージビューのレイアウト範囲外

おかげで前進 !

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" android:layout_height="match_parent" 
android:background="#E0E0E0" 
    > 
<com.androidsources.welcomescreen.MyRecyclerView 
    android:foreground="?android:attr/selectableItemBackground" 
    android:clickable="true" 
    android:id="@+id/cardList" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    /> 
    <com.anupcowkur.wheelmenu.WheelMenu 
    android:id="@+id/wheelMenu" 
    android:layout_width="300dp" 
    android:layout_height="300dp" 


    android:src="@drawable/wheel"/> 
    </RelativeLayout> 
+0

あなたのXMLレイアウトを投稿 – hehe

+0

編集した投稿を確認してください – TrulyXax

+0

私はどんなスクリーンサイズにも固定されたいです – TrulyXax

答えて

1

あなたはこのような何かを試すことができます。

<com.anupcowkur.wheelmenu.WheelMenu 
    android:id="@+id/wheelMenu" 
    android:layout_width="300dp" 
    android:layout_height="300dp" 

    android:layout_alignParentRight="true" 
    android:layout_alignParentBottom="true" 
    android:paddingLeft="150dp" 
    android:paddingTop="150dp" 

    android:src="@drawable/wheel"/> 

alignParentRightalignParentBottom属性が右下隅にウィジェットを移動します。また、希望の視覚効果を達成するためにpaddingを変更しようとします。

+0

素晴らしい、ありがとう! – TrulyXax

+0

それを試みたが、それは私のために働かなかった、私はなぜだろうか?私が直線レイアウトの中にイメージを囲むと、私の作品が動作します。 – hehe

0

私はすでに回答があることを知っていますが、受け入れられた回答をここで行うことができない人にとっては、代替案です。

私はRelativeLayoutを使用している場合何らかの理由で、私は親の外にビューの一部を配置することはできませんが、私はLinearLayoutを試してみました。だから私が使用した解決策は、LinearLayoutにビューを囲み、LinearLayoutを親のボトムエンドに配置することです。

<LinearLayout 
    android:layout_width="300dp" 
    android:layout_height="300dp" 
    android:orientation="horizontal" 
    android:layout_alignParentBottom="true" 
    android:layout_alignParentEnd="true"> 

    <ImageView 
     android:layout_width="300dp" 
     android:layout_height="300dp" 
     android:src="@drawable/some_pic" 
     android:layout_marginStart="150dp" 
     android:layout_marginTop="150dp"/> 

</LinearLayout> 

注画像の幅と高さは、それを移動しない画像を縮小するmatch_parentを使用して、match_parentありません。