查了好多网上的 说什么启动模式之类的,但是和我其他页面的一样,其他页面的是正常的。
好吧,那问题看了就在新启动的acitivity上了,但是我这个activity没什么业务,是一个写评论的页面
情况一:布局问题
将我下面的注释放开,根布局改为linearLayout Listview可以换成ScrollView ,这个时候,就获取不到值,改为现在的就可以获取值,不知道为什么
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/write_comment_root_v"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#50000000"
>
<!--<ListView-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="0dp"-->
<!--android:layout_weight="1">-->
<!--</ListView>-->
<!--<RelativeLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent">-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="47dp"
android:layout_alignParentBottom="true"
android:background="#f0f0f0">
<EditText
android:id="@+id/write_comment_et"
android:layout_width="match_parent"
android:layout_height="36dp"
android:layout_centerInParent="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_toLeftOf="@+id/write_comment_send_tv"
android:background="@drawable/shape_rounded_rectangle_write_comment_edit_bg"
android:gravity="left|center_vertical"
android:hint="请输入评论"
android:textColorHint="@color/skin_text_color2"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textSize="16dp" />
<TextView
android:id="@+id/write_comment_send_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="0dp"
android:layout_marginRight="5dp"
android:text="发表"
android:textSize="15dp"
android:textColor="@color/black"
/>
</RelativeLayout>
<!--</RelativeLayout>-->
</RelativeLayout>
情况二:键盘启动模式问题
android:windowSoftInputMode
android:windowSoftInputMode="adjustResize"上面的布局,的键盘模式设置为默认的 是可以获取到值的,
但是改为android:windowSoftInputMode="adjustResize" 就获取不到了
具体 各位看业务了
求大牛解惑