소프트웨어 키보드가있는 경우 목록보기 크기를 조정할 때 약간 문제가 있습니다. 기본적으로 내지도는 투명한 액션 바를 사용하여 전체 화면을 덮는 google maps api를 사용하고 있습니다. 오른쪽에서 슬라이드를 가져 와서지도에있는 vehicels 목록이 있습니다. 오른쪽 창 밖으로 경우 전체 레이아웃은 다음과 같습니다 : 내가 편집 텍스트를 집중하고 키보드 밖으로 슬라이드 할 때 내가 사용하고 이제키보드가있는 경우 목록보기 크기 조정
android:windowSoftInputMode="adjustPan"
그래서, 그것은 다음과 같습니다
느릅 나무가 잘되지 않기 때문에 그럴 수 없어 차량 전체를 보라. android:windowSoftInputMode="adjustResize"
을 사용해 보았습니다. 그러나 투명한 액션 바를 사용하고 있기 때문에 다음과 같은 일이 발생합니다. 전체 listView를 볼 수 있으며 멋지게 스크롤되지만 내 EditText는 이제 ActionBar 아래에 있습니다. 기본적으로 내가 무엇을 달성하고자하는 것은이 같이 있도록 두 경우 모두의 조합입니다 : 지금이 조각에 대한 레이아웃은 내 목록
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@drawable/bg"
tools:context="hidden">
<EditText
android:id="@+id/vehicle_search_edit_text"
android:layout_width="fill_parent"
android:layout_height="45dp"
android:focusable="true"
android:hint="Search"
android:imeOptions="actionSearch"
android:singleLine="true" />
<ListView
android:id="@+id/list_vehicles"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/vehicle_search_edit_text"
android:animateLayoutChanges="true"
android:fastScrollEnabled="true"
/>
</RelativeLayout>
함께 그리고 이것은 내 MainActivity의 레이아웃입니다
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/layout_root_map"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
android:id="@+id/layout_root_vehicles"
android:layout_width="350dp"
android:layout_height="match_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" />
<RelativeLayout
android:id="@+id/layout_root_settings"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" />
</RelativeLayout>
나는 레이아웃의 높이를 프로그램 적으로 설정하는 것에 익숙하다. 왜냐하면 나는 이미 listfragment가 중첩 된 레이아웃을 가지고 있기 때문이다. 액션 바는 사장님이 원하는 방식으로 투명해야합니다. 나는 하루 종일 해결책을 찾고 있었지만 나를 찾은 것은 아무것도 찾지 못했기 때문에 어떤 도움을 주셔서 감사합니다.
MainActivity.xml을 변경하고 alignParentBottom을 alignParentTop으로 변경해야했지만이 방법이 효과적입니다. 답변으로 표시했습니다. –
android : paddingTop = "? android : attr/actionBarSize와 함께 작동 했습니까? 값을 바꾸려면? 내가 직접 테스트 할 기회가 없기 때문에 묻고있다. –
네, 완벽하게 작동합니다. 자신을 알아 내지 못했다고는 믿을 수 없습니다. –