2012-01-02 38 views
11

Khi tôi viết nội dung nào đó vào văn bản chỉnh sửa trong ứng dụng, bàn phím mềm đi kèm với bố cục tương đối phía dưới .. Tôi muốn sửa vị trí bố cục tương đối thấp cố định.Giúp trợ giúp sẽ được đánh giá cao ..cách khắc phục bố cục tương đối dưới cùng khi bàn phím mềm xuất hiện?

+2

đặt một số mã của bạn. –

+0

cần mã xml của bạn. –

+0

mọi giải pháp chưa? –

Trả lời

1

thêm này trong thẻ hoạt động của bạn trong tập tin manifest.xml

android:softinputmode="adjustNothing" 
+1

Tôi muốn sửa chỉ bố cục dưới cùng .. Đồng thời tất cả các Chế độ xem khác phải được điều chỉnh, theo nghĩa là văn bản Chỉnh sửa của tôi hiển thị đầy đủ cho người dùng .. – hacker

+0

Tôi cũng đang tìm kiếm cùng một loại giải pháp như @hacker –

17

tôi đoán Padma Kumar nghĩa android:windowSoftInputMode="adjustNothing" trên thẻ hoạt động biểu hiện của bạn.

+0

oh vâng bạn đúng. –

+1

tsk tsk, làm thế nào điều này nhận được rất nhiều phiếu bầu? 'adjustNothing' thậm chí không phải là một tùy chọn - http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft – Abhijit

1

Tạo một bố cục giả với bất kỳ giá trị chiều cao, sau đó tham chiếu đến nó:

<RelativeLayout 
    android:id="@+id/rl_fake" 
    android:layout_width="fill_parent" 
    android:layout_height="320dp" > 
</RelativeLayout> 

<RelativeLayout 
    android:id="@+id/rl_main_view" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 
    ... 
</RelativeLayout> 
... 
<RelativeLayout 
    android:id="@+id/rl_problem" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_below="@+id/rl_fake" > 
    ... 
</RelativeLayout> 
0

Trong bố trí tương đối dán đoạn mã sau

<LinearLayout 
     android:id="@+id/ll_button" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:gravity="center" 
     android:orientation="horizontal" 
     android:layout_marginTop="@dimen/_16dp"> 

     <Button 
      android:id="@+id/btn_continue" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:background="@color/colorPrimary" 
      android:text="@string/conti" 
      android:padding="@dimen/_8dp" 
      android:textColor="@color/white" 
      android:textSize="@dimen/_16sp" /> 
    </LinearLayout> 
Các vấn đề liên quan