2016-06-16 10 views
0

Scheint ziemlich einfach, aber das kann nicht richtig. Ich habe mir eine Menge Beispiele angesehen, aber ich bekomme entweder die Schaltfläche (n), die den gesamten Bildschirm ausfüllen, oder die Webansicht, die den gesamten Bildschirm ausfüllt. Ich möchte es so aussehen (mit dem webView den Bildschirm füllen, egal was die Auflösung), außer dass der Boden 2 Tasten haben würde (Ja sie sind hässlich, aber ich werde beheben, dass später):WebView mit Tasten auf der Unterseite

enter image description here

Die XML derzeit:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/ssoViewerLayout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 

     <WebView 
      android:id="@+id/ssoViewer" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:layout_weight="0"/> 

     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:tools="http://schemas.android.com/tools" 
      android:layout_width="fill_parent" 
      android:layout_height="match_parent" 
      android:orientation="horizontal" 
      android:layout_height="0dip" 
      android:layout_weight="1" 
      android:gravity="center|bottom">  

      <Button 
       android:id="@+id/cancelSSO" 
       android:layout_marginTop="16dp" 
       android:layout_width="125dp" 
       android:layout_height="55dp" 
       android:layout_margin="5dp" 
       android:onClick="cancelSSOClick" 
       android:text="Cancel Login" 
       android:background="@drawable/button_login" /> 
      <Button 
       android:id="@+id/resetSSO" 
       android:layout_marginTop="16dp" 
       android:layout_width="125dp" 
       android:layout_height="55dp" 
       android:layout_margin="5dp" 
       android:onClick="resetSSOClick" 
       android:text="Reset SSO" 
       android:background="@drawable/button_login"/> 
    </LinearLayout> 
</LinearLayout> 

Danke!

UPDATE

Dank Arpit Ratan Antwort, mit ein paar Änderungen habe es zu arbeiten. Die endgültige XML wie folgt aussieht:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:tools="http://schemas.android.com/tools" 
      android:id="@+id/ssoViewerLayout" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" > 

      <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
       xmlns:tools="http://schemas.android.com/tools" 
       android:id="@+id/button_layout" 
       android:layout_width="match_parent" 
       android:orientation="horizontal" 
       android:layout_height="wrap_content" 
       android:gravity="center|bottom" 
       android:layout_alignParentBottom="true">  

       <Button 
        android:id="@+id/cancelSSO" 
        android:layout_marginTop="16dp" 
        android:layout_width="125dp" 
        android:layout_height="55dp" 
        android:layout_margin="5dp" 
        android:onClick="cancelSSOClick" 
        android:text="Cancel Login" 
        android:background="@drawable/button_login" /> 
       <Button 
        android:id="@+id/resetSSO" 
        android:layout_marginTop="16dp" 
        android:layout_width="125dp" 
        android:layout_height="55dp" 
        android:layout_margin="5dp" 
        android:onClick="resetSSOClick" 
        android:text="Reset SSO" 
        android:background="@drawable/button_login"/> 
     </LinearLayout> 
    <WebView 
       android:id="@+id/ssoViewer" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_above="@id/button_layout" /> 
    </RelativeLayout> 

Antwort

2

Ändern Sie es an:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:tools="http://schemas.android.com/tools" 
      android:id="@+id/ssoViewerLayout" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" > 


       <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        xmlns:tools="http://schemas.android.com/tools" 
        android:id="@+id/button_layout" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:orientation="horizontal" 
       android:layout_height="0dip" 
       android:gravity="center|bottom" 
       android:alighParentBottom="true">  

       <Button 
        android:id="@+id/cancelSSO" 
        android:layout_marginTop="16dp" 
        android:layout_width="125dp" 
        android:layout_height="55dp" 
        android:layout_margin="5dp" 
        android:onClick="cancelSSOClick" 
        android:text="Cancel Login" 
        android:background="@drawable/button_login" /> 
       <Button 
        android:id="@+id/resetSSO" 
        android:layout_marginTop="16dp" 
        android:layout_width="125dp" 
        android:layout_height="55dp" 
        android:layout_margin="5dp" 
        android:onClick="resetSSOClick" 
        android:text="Reset SSO" 
        android:background="@drawable/button_login"/> 
     </LinearLayout> 
    <WebView 
       android:id="@+id/ssoViewer" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:layout_above="@id/button_layout" /> 
    </RelativeLayout> 
0

Dieses kann etwas sein, was Sie brauchen in einem Fragment zu setzen, ich Dinge wie die Bekämpfung jeder gesehen haben andere für Immobilien, insbesondere für verschiedene Geräte.

Verwandte Themen