我有一个活动。它有一个垂直的线性布局。当软键盘打开时,它会按调整大小或平移推入线性布局。但是我想将linearlayout的顶部切碎并推动它。“ adjustResize”和“ adjustPan”与我所说的不同。我该怎么办?
android:windowSoftInputMode="adjustResize"
在清单文件内的活动标签中定义此属性。把LinearLayout
里面ScrollView
的例子
<ScrollView
android:id="@+id/scrollParent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/includeHeader"
android:scrollbars="none" >
<RelativeLayout
android:id="@+id/relCardManagement"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:background="@color/white_font"
android:gravity="center_horizontal"
android:padding="10dp" >
<!-- 1st start -->
<RelativeLayout
android:id="@+id/relChangePin"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/drawable_editplan"
android:padding="5dp" >
<ImageView
android:id="@+id/imageLogoChangePin"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tvChangePin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/imageLogoChangePin"
android:text="@string/chnge_pin"
android:textColor="@color/black_font" />
<ImageView
android:id="@+id/imageArrowChangePin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/ic_arrow_image" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/relChangePinListener"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/relChangePin"
android:visibility="gone" >
<include
android:id="@+id/includeChangePin"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
layout="@layout/change_pin_activity" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
我希望这能帮到您。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句