大佬教程收集整理的这篇文章主要介绍了android – 如果我在键盘弹出时设置linearlayout重量,它会调整其大陆的大小,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
但当我按下编辑文本键盘弹出时,它会混淆布局重量
如何使ImageView成为静态,当键盘打开时,它将保持相同的大小?
XML:
<android.support.design.widget.CoordinatorLayout xmlns:android="http://scheR_206_11845@as.android.com/apk/res/android" xmlns:app="http://scheR_206_11845@as.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:BACkground="@color/white" android:focusableInTouchMode="true"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:id="@+id/ViewA" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="0.6" android:BACkground="@color/colorPriMary" android:orientation="horizontal"> <ImageView android:id="@+id/imgview" android:layout_width="fill_parent" android:layout_height="match_parent" android:BACkground="@color/lighT_Blue" android:scaleType="centerCrop" android:src="@android:drawable/ic_menu_camera" android:layout_gravity="top|center_horizontal" /> </LinearLayout> <LinearLayout android:id="@+id/ViewB" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="0.3" android:orientation="horizontal"> </LinearLayout> </LinearLayout> <android.support.design.widget.FloaTingActionButton android:id="@+id/add_image" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/fab_margin" app:layout_anchor="@id/ViewA" android:clickable="true" app:layout_anchorGravity="bottom|right" app:elevation="5dp" app:pressedTranslationZ="0dp" android:src="@android:drawable/ic_menu_camera"/> </android.support.design.widget.CoordinatorLayout>
<application android:allowBACkup="true" android:icon="@drawable/ic_launcher" android:label="@String/app_name" android:theme="@style/AppTheme" > <activity android:name="com.example.MainActivity" android:label="@String/app_name" android:windowSofTinputMode="adjustPan" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application>
以上是大佬教程为你收集整理的android – 如果我在键盘弹出时设置linearlayout重量,它会调整其大陆的大小全部内容,希望文章能够帮你解决android – 如果我在键盘弹出时设置linearlayout重量,它会调整其大陆的大小所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。