android:windowSoftInputMode="adjustResize|stateUnchanged"
最常用的组合是上边.
如果edit包在scrollview里的话他就会自动在 edit下边显示
如果edit在scrollview的话
那么edit会覆盖scrollview的部分并显示在键盘上边
下边是举例
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:scrollbars="none">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="@dimen/item_height"
android:orientation="horizontal"
android:background="@drawable/view_item_line"
android:gravity="center_vertical"
android:layout_margin="@dimen/dp10">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="@dimen/alim_create_item_text_size"
android:textColor="@color/black"
android:background="@null"
android:gravity="center_vertical"
android:text="원아명"
android:layout_marginLeft="@dimen/dp10"
android:visibility="gone"/>
<TextView
android:id="@+id/gallary_lool_class_name_textview"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="@dimen/alim_create_item_text_size"
android:textColor="@color/black"
android:background="@null"
android:gravity="center_vertical"
android:layout_marginLeft="@dimen/dp10"
android:text="반명"
android:layout_weight="0"
/>
<TextView
android:id="@+id/gallary_lool_student_name_textview"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:textSize="@dimen/alim_create_item_text_size"
android:textColor="@color/black"
android:background="@null"
android:gravity="center_vertical"
android:layout_marginLeft="@dimen/dp10"
android:text="원아명"
android:layout_weight="1"
/>
<TextView
android:id="@+id/gallary_photo_look_golist_textview"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="@dimen/alim_create_item_text_size"
android:textColor="@color/black"
android:background="@null"
android:gravity="center_vertical"
android:layout_marginLeft="@dimen/dp10"
android:text="목록보기"
android:layout_weight="0"
android:paddingRight="@dimen/dp5"
android:paddingLeft="@dimen/dp10"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp10"
android:layout_marginRight="@dimen/dp10"
android:paddingRight="@dimen/dp10"
android:paddingLeft="@dimen/dp10"
android:paddingBottom="@dimen/dp10"
android:background="@drawable/view_item_line"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/dp10">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/gallary_list_item_title_icon"/>
<TextView
android:id="@+id/gallary_photo_look_title_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp10"
android:textSize="@dimen/alim_create_item_text_size"
android:textColor="@color/black"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/gallary_photo_look_imgs_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
</LinearLayout>
<TextView
android:id="@+id/gallary_photo_look_content_textview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="16dp"
android:layout_marginTop="@dimen/dp10"
android:textColor="@color/black"/>
</LinearLayout>
<!-- 댓글 보기 영역 -->
<LinearLayout
android:id="@+id/alim_look_component_list_layout"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/alim_look_comment_list_bg"
android:layout_marginTop="@dimen/dp10"
android:paddingBottom="@dimen/dp10"
android:visibility="invisible">
</LinearLayout>
</LinearLayout>
</ScrollView>
<!-- 댓글 쓰기 모듈-->
<LinearLayout
android:layout_weight="0"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="7dp"
android:paddingBottom="7dp"
android:paddingLeft="@dimen/dp10"
android:gravity="center">
<EditText
android:id="@+id/alimt_comment_input_edit"
android:background="@drawable/view_item_line"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:textSize="12dp"
android:textColor="#818181"
android:paddingLeft="6dp"
android:hint="댓글쓰기"
android:layout_weight="1"/>
<ImageView
android:id="@id/alim_comment_submit_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/comment_send_icon"
android:paddingLeft="16dp"
android:paddingRight="13dp"/>
</LinearLayout>
</LinearLayout>
没有评论:
发表评论