这是包含组件的布局,我试过
编辑1:更多解释 当我专注于任何编辑文本时,布局不会按预期向上滚动。编辑文本得到了焦点,它显示了键盘(隐藏了几乎一半的布局),我无法向上滚动以查看其下方的其他组件,如单选按钮和最后一个按钮。
机器人:windowSoftInputMode =" adjustResize"在没有运气的清单中。
FragmentLayout
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/home_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
android:paddingLeft="@dimen/newfeedback_padding_maincontainer"
android:paddingRight="@dimen/newfeedback_padding_maincontainer"
android:paddingTop="10dp" >
<LinearLayout
android:id="@+id/new_feed_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="40dp"
android:gravity="center"
android:minHeight="50dp"
android:padding="5dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/main_blue_light" />
<EditText
android:id="@+id/txt_dr_name_dr"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginTop="@dimen/new_feedback_items_margin_top"
android:drawableRight="@drawable/dr_name"
android:gravity="right|center_vertical"
android:minHeight="50dp" />
<Spinner
android:id="@+id/sp_medtype"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="@drawable/spinner_bg_final"
android:gravity="right"
android:minHeight="50dp" />
<RadioGroup
android:id="@+id/rg_gender"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="@dimen/new_feedback_items_margin_top"
android:gravity="center_vertical"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/rb_dr_female"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="@null"
android:drawableRight="@android:drawable/btn_radio"
android:gravity="right|center_vertical"
/>
<RadioButton
android:id="@+id/rb_dr_male"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:button="@null"
android:checked="true"
android:drawableRight="@android:drawable/btn_radio"
android:gravity="right|center_vertical"
/>
</RadioGroup>
<Spinner
android:id="@+id/sp_govern"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="@drawable/spinner_bg_final"
android:gravity="right"
android:minHeight="50dp" />
<Spinner
android:id="@+id/sp_specializations"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="@drawable/spinner_bg_final"
android:gravity="right"
android:minHeight="50dp" />
<EditText
android:id="@+id/txt_phone"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginTop="@dimen/new_feedback_items_margin_top"
android:drawableRight="@drawable/ic_phone"
android:gravity="right|center_vertical"
android:inputType="phone"
android:minHeight="50dp" />
<EditText
android:id="@+id/txt_address"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginTop="@dimen/new_feedback_items_margin_top"
android:drawableRight="@drawable/ic_home"
android:gravity="right|center_vertical"
android:minHeight="50dp" />
<EditText
android:id="@+id/txt_feedback"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginTop="@dimen/new_feedback_items_margin_top"
android:gravity="right"
android:inputType="textMultiLine"
android:minHeight="50dp" />
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="@dimen/new_feedback_items_margin_top"
android:gravity="center_vertical"
android:orientation="vertical" >
<RadioButton
android:id="@+id/rb_eval3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_weight="1"
android:button="@null"
android:checked="true"
android:drawableRight="@android:drawable/btn_radio"
android:gravity="right|center_vertical"
/>
<RadioButton
android:id="@+id/rb_eval2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="@null"
android:drawableRight="@android:drawable/btn_radio"
android:gravity="right|center_vertical"
/>
<RadioButton
android:id="@+id/rb_eval1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="@null"
android:drawableRight="@android:drawable/btn_radio"
android:gravity="right|center_vertical"
/>
</RadioGroup>
<Button
android:id="@+id/btn_addfeedbck"
style="@style/green_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:minHeight="48dp" />
</LinearLayout>
</ScrollView>
Manifest.xml
<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat.Light.FullScreen" >
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name="com.iii.MainActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" >
</activity>
</activity>
</application>
答案 0 :(得分:0)
问题在于
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
我不应该在全屏模式下调整窗口大小。