2014-09-03 47 views
2

有人知道如何避免鍵盤上方的黑線?它成爲我的鍵盤顯示預測字符線後。鍵盤上方的黑線

Line with help words

Line after help words

在我的層我用的片段,我需要用下面的EditText秀行。但是,當用戶結束打字,他看到黑線以上的鍵盤,是不是需要

這裏是我的代碼:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 

xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
> 

<!-- TODO: Update blank fragment layout --> 
<FrameLayout 
    android:layout_width="match_parent" 

    android:layout_height="0dp" 
    android:layout_weight="1" 

    android:id="@+id/word_set_fragment_container" 
    > 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:text="Experimental layer" 
     /> 


</FrameLayout> 

<LinearLayout 

    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal" 
    android:background="@drawable/border" 

    android:paddingTop="5dp" 
    android:paddingBottom="3dp" 
    android:clickable="true" 
    > 
    <Button 

     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="⇣" 
     android:layout_gravity="bottom"/> 
    <EditText 

     android:inputType="text|textCapSentences" 
     android:imeOptions="actionDone" 
     android:layout_weight="1" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_gravity="bottom" 
     android:hint="@string/hint_new_word" 
     android:text="" 
     /> 
</LinearLayout> 

</LinearLayout> 

對不起,我的英語水平。

回答

0

這看起來像它的實際Android鍵盤..哪些是不能改變的。

2

爲了避免在鍵盤黑線,你應該android:padding="0px"添加layout_margin="0px"和你的鍵盤佈局xml文件

<android.inputmethodservice.KeyboardView 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/keyboard" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_margin="0px" 
    android:padding="0px" 
    android:layout_alignParentBottom="true" 
    android:keyPreviewLayout ="@layout/preview"/>