2017-11-09 3 views

答えて

1

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <LinearLayout 
     android:layout_alignParentBottom="true" 
     android:gravity="bottom" 
     android:orientation="horizontal" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 
     <EditText 
      android:gravity="left" 
      android:background="#e4e4e4" 
      android:layout_width="0dp" 
      android:layout_weight="8" 
      android:layout_height="match_parent" /> 
     <LinearLayout 
      android:orientation="vertical" 
      android:layout_weight="2" 
      android:layout_width="0dp" 
      android:layout_height="wrap_content"> 
      <Button 
       android:text="Done" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" /> 
      <Button 
       android:text="Del" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" /> 
     </LinearLayout> 
    </LinearLayout> 
</RelativeLayout> 

をsample.xmlにレイアウトファイルを作成しますSample.java活動は、あなたがマニフェストファイルにandroid:windowSoftInputMode="adjustResize"を追加していることを確認してください

public class Sample extends Activity { 
    @Override 
    protected void onCreate(@Nullable Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.sample); 
    } 
} 

のファイルを作成します以下のように。

<activity android:name=".Sample" 
      android:windowSoftInputMode="adjustResize"> 
</activity> 

enter image description here

+0

だけでなく、一つの活性は、私はそれが他の活動に使用することを願って、顧客のソフトキーパッドにする必要があります。 – Chunhua

関連する問題