2016-07-05 3 views
1

웹 뷰가 있으며, 아래로 스크롤하면 스위치가 나타납니다. 내 문제는 스위치가 webview의 마지막 줄과 겹쳐져 있다는 것입니다. 부모 레이아웃의 패딩을 설정하려고했지만 그 문제는 항상 레이아웃이 표시된다는 것입니다. 맨 아래에 공간을 추가하기 위해 webview 내부에 무언가를 추가 할 수 있습니까? 또는 주변의 상대적 레이아웃 내부에 무언가를 추가 할 수 있습니까?아래 공간을 추가하십시오. Webview

편집 :

<RelativeLayout 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
    android:orientation="vertical"> 

<WebView 
    android:id="@+id/webView" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" /> 
</RelativeLayout> 

<android.support.v7.widget.SwitchCompat 
    android:id="@+id/opt_out_switch" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:alpha="0" 
    android:background="#FFEFEEEE" 
    android:text="@string/optout" 
    android:theme="@style/switchTheme" /> 

<ProgressBar 
    android:id="@+id/progressBar" 
    style="@style/Widget.AppCompat.ProgressBar" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_centerInParent="true" 
    android:visibility="gone" /> 
</RelativeLayout> 
+0

당신은 당신의 게시 레이아웃에'Switch'이없는 - 당신은 프로그래밍 방식으로 추가하는 방법은 무엇입니까? 어떻게 거기에 도착합니까? – yennsarah

+0

전체 레이아웃 파일을 게시하십시오 –

+0

전체 레이아웃 파일을 –

답변

2

사용 LinearLayout 당신이 필요 달성하기 :

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

    <WebView 
     android:id="@+id/webView" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" /> 

    <android.support.v7.widget.SwitchCompat 
     android:id="@+id/opt_out_switch" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:alpha="0" 
     android:background="#FFEFEEEE" 
     android:text="@string/optout" 
     android:theme="@style/switchTheme" /> 

    <ProgressBar 
     android:id="@+id/progressBar" 
     style="@style/Widget.AppCompat.ProgressBar" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" /> 
</LinearLayout> 
+0

게시하면 스위치가 전혀 표시되지 않습니다 –

+0

'android : alpha = "0"'이 (가) 있습니다. 그것을 제거합니다 –

+0

그것은 programically 제거됩니다, 그것은 상대 레이아웃에 그것을 스크롤하고 아래로 표시됩니다. –

관련 문제