2017-05-09 20 views
0

我已經看到無數線程關於如何禁用滾動活動文本字段的標準Android行爲或在屏幕鍵盤彈出時調整當前活動的大小,但我的問題恰恰相反。在我的應用程序中不會滾動也不會調整大小。ENABLE在彈出的鍵盤上調整大小或滾動活動

我需要做些什麼來實現正確的行爲?

<?xml version="1.0" encoding="utf-8"?> 

<!-- The main content view --> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/RootView" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="?colorPrimary"> 

    <com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/slidingPanel" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:gravity="bottom" 
     sothree:umanoFadeColor="@android:color/transparent" 
     sothree:umanoOverlay="true" 
     sothree:umanoPanelHeight="200dp" 
     sothree:umanoShadowHeight="0dp"> 

     <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      android:id="@+id/drawer_layout" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 

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

      <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
       android:id="@+id/scrollView1" 
       android:layout_width="@dimen/lewa_lista_size" 
       android:layout_height="match_parent" 
       android:layout_gravity="start" 
       android:background="?xenoPanelBackgroundColor"/> 
     </android.support.v4.widget.DrawerLayout> 

     <RelativeLayout 
      android:id="@+id/playlist" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:gravity="center"> 

      <LinearLayout 
       android:id="@+id/chwytak" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:background="@drawable/tlo_kropek" 
       android:orientation="vertical"> 

       <ImageView 
        android:id="@+id/kropki" 
        android:layout_width="match_parent" 
        android:layout_height="@dimen/uchwyt_szuflady_height" 
        android:layout_centerHorizontal="true" 
        android:gravity="center_horizontal" 
        android:src="@mipmap/kropki" /> 

       <RelativeLayout 
        android:id="@+id/wypelniaczGorny" 
        android:layout_width="match_parent" 
        android:layout_height="0dp"/> 
      </LinearLayout> 

      <android.support.v7.widget.Toolbar 
       android:id="@+id/playlistAB" 
       style="?xenoActionBarTheme" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_below="@id/chwytak" 
       android:elevation="4dp" 
       android:minHeight="?attr/actionBarSize"> 

       <Spinner 
        android:id="@+id/spinner_toolbar" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" /> 
      </android.support.v7.widget.Toolbar> 

      <RelativeLayout 
       android:id="@+id/wypelniacz" 
       android:layout_width="match_parent" 
       android:layout_height="0dp" 
       android:layout_alignParentBottom="true" 
       android:background="?xenoPanelBackgroundColor"/> 

      <android.support.v4.view.ViewPager 
       android:id="@+id/pager" 
       android:layout_width="match_parent" 
       android:layout_height="0dp" 
       android:layout_above="@id/wypelniacz" 
       android:layout_below="@id/playlistAB" 
       android:background="?xenoPanelBackgroundColor"/> 
     </RelativeLayout> 
    </com.sothree.slidinguppanel.SlidingUpPanelLayout> 

</FrameLayout> 
+0

是您的活動全屏得到合適的屬性? –

+0

嗯 - 是的。還有其他類型的活動嗎? – ssuukk

+0

將您的活動和佈局代碼粘貼到此處。如果您的活動是全屏顯示,那麼您的佈局不會在鍵盤彈出窗口中調整大小。 –

回答

1

您可以使用windowSoftInputMode財產清單中這裏activiy是例如

<activity 
    android:windowSoftInputMode="adjustPan" 
    android:name=".YourActivity"></activity> 

活動的主窗口如何與包含屏幕上的軟鍵盤的窗口交互。此屬性的設置會影響兩件事: 當活動成爲用戶關注的焦點時,軟鍵盤的狀態 - 無論是隱藏的還是可見的。 對活動主窗口所作的調整 - 是否爲軟鍵盤調整縮小尺寸以騰出空間,或者當軟鍵盤覆蓋部分窗口時,其內容是否平移以使當前焦點可見。

這裏u得到更多信息https://developer.android.com/guide/topics/manifest/activity-element.html

您可以根據您的要求

+0

是的,這幾乎是可以接受的:視圖確實滾動,但只是爲了讓編輯過的線出現在鍵盤上方。如果在當前行下面有更多可編輯的行,我無法向上滾動視圖。我必須彈出軟鍵盤並選擇下面的下一行。任何解決方案? – ssuukk

相關問題