2016-08-30 7 views
-3

の外に、私はこのような何かを達成しようとしている:一部は、ダイアログ

Check image

誰でもボタンがダイアログ外に部分的にとどまるようにする方法のアイデアを持っていると、下の常にありませんテキスト?ここで

は私のダイアログのレイアウトです:

<?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:alpha="180" 
    android:orientation="vertical"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="24dp" 
     android:layout_marginRight="24dp" 
     android:layout_marginTop="24dp" 
     android:background="@drawable/actionbar_selector" 
     android:orientation="vertical" 
     android:weightSum="1"> 

     <ImageView 
      android:id="@+id/imageView4" 
      android:layout_width="100dp" 
      android:layout_height="100dp" 
      android:layout_gravity="center_horizontal" 
      android:layout_marginTop="8dp" 
      android:src="@drawable/ic_error_outline" /> 

     <TextView 
      android:id="@+id/textView" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_horizontal" 
      android:layout_marginTop="16dp" 
      android:text="@string/drive_carefully_title" 
      android:textAppearance="?android:attr/textAppearanceMedium" 
      android:textColor="@color/blue_light" /> 

     <TextView 
      android:id="@+id/textView6" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_horizontal" 
      android:layout_marginLeft="16dp" 
      android:layout_marginRight="16dp" 
      android:layout_marginTop="32dp" 
      android:text="@string/drive_carefully_message" 
      android:textAppearance="?android:attr/textAppearanceSmall" 
      android:textColor="@color/blue_light" /> 

     <TextView 
      android:id="@+id/ok_button" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_gravity="center" 
      android:layout_marginBottom="16dp" 
      android:layout_marginTop="32dp" 
      android:layout_weight="0.18" 
      android:paddingBottom="8dp" 
      android:paddingLeft="16dp" 
      android:paddingRight="8dp" 
      android:paddingTop="8dp" 
      android:autoText="false" 
      android:background="@drawable/ok_button" 
      android:textColor="@color/blue_medium" 
      android:text="@string/ok" 
      android:textSize="24dp" 
      android:clickable="true" 
      android:layout_marginLeft="64dp" 
      android:gravity="center" 
      android:textStyle="bold"> 
     </TextView> 

    </LinearLayout> 

</RelativeLayout> 

そして、ここではそれがこの時点でどのように見えるかです:

enter image description here

+2

* XMLコードを投稿してください。 –

+0

カスタムレイアウトをフルスクリーンで使用できます。その境界線を**透過**にして**ボタンを境界線の外に出るように**表示させる。 –

+0

なぜあなたは**未使用** RelativeLayoutを持っていますか?ネストされたレイアウトは**パフォーマンスに悪い**です。 –

答えて

-1

あなたはそれのDrawableを持っている場合は、以下のようにそれを行うことができます。ちょうどそのDrawableの参照をImageViewに渡してください。

<?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="@android:color/transparent" 
    android:orientation="vertical"> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_margin="25dp" 
     android:background="#111111"> 


     <!--Your rest of xml code--> 

    </LinearLayout> 


    <ImageView 
     android:layout_width="100dp" 
     android:layout_height="50dp" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentRight="true" 
     android:layout_alignParentEnd="true" 
     android:layout_marginBottom="50dp" 
     android:src="@drawable/logo" /> 

</RelativeLayout> 

あなたの要件ごとにHeightImageWidthを設定します。

+0

@Downvoterはここでdownvoteの理由を打ちます。私はOPで尋ねられたことを達成するための別の方法を与えました。私が改善できるようにあなたの理由を撃ちなさい。 –

+0

私はdownvotedと正しいとあなたの答えをマークしたものではないが、私は1つのimprovmentをお勧めします。 ImageViewをLinearLayoutの下に設定し、上端に-50dpを設定すると、ダイアログが全画面表示になる必要はありません。助けてくれてありがとう。 –

関連する問題