niorgai / StatusBarCompat

Status Bar Utils ---- Change Status Bar Mode Simply
http://niorgai.github.io/2016/03/20/Android-transulcent-status-bar/
MIT License
2.16k stars 349 forks source link

StatusBarCompat.translucentStatusBar(this, true); 谈不上去, #45

Closed dahai2070 closed 5 years ago

dahai2070 commented 5 years ago

StatusBarCompat.translucentStatusBar(this, true); 键盘 弹不上去了

niorgai commented 5 years ago

需要具体一点, 最好有能复现的代码

dahai2070 commented 5 years ago

哇,这么看有回复啊, <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/common_bg" android:orientation="vertical" tools:context="com.srbl.mytx.activity.TopicDetailsActivity">

<android.support.v4.widget.NestedScrollView
    android:id="@+id/sv_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:weightSum="1">

        <cn.jzvd.JzvdStd
            android:id="@+id/video_player"
            android:layout_width="match_parent"
            android:layout_height="400dp" />

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/tv_goods_address"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="5dp"
                android:layout_toRightOf="@+id/iv_goods_location"
                android:text="重庆.渝北区"
                android:visibility="gone" />

            <ImageView
                android:id="@+id/iv_goods_location"
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_alignParentLeft="true"
                android:layout_marginLeft="5dp"
                android:src="@drawable/location"
                android:visibility="gone" />

        </RelativeLayout>

        <TextView
            android:id="@+id/tv_goods_description"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:text="内容描述"
            android:textSize="16sp" />

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_picture_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </android.support.v7.widget.RecyclerView>

        <View
            android:layout_width="match_parent"
            android:layout_height="10dp"
            android:background="@color/gray_background" />

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_comment_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </android.support.v7.widget.RecyclerView>

    </LinearLayout>

</android.support.v4.widget.NestedScrollView>

<RelativeLayout
    android:id="@+id/title_bar"
    android:layout_width="match_parent"
    android:layout_height="50dp"
    android:layout_marginTop="20dp"
    android:background="@color/btn_white_normal">

    <ImageView
        android:id="@+id/iv_back"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_centerVertical="true"
        android:layout_marginStart="10dp"
        android:src="@drawable/ease_mm_title_back" />

    <com.srbl.mytx.widget.MyTextView
        android:id="@+id/tv_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_marginStart="70dp"
        android:gravity="center"
        android:lines="1"
        android:text="我是标题"
        android:textSize="20sp"
        app:colorPosition="1"
        app:endColor="@color/text_black"
        app:startColor="@color/white" />
</RelativeLayout>

<com.srbl.mytx.widget.PeriscopeLayout
    android:id="@+id/periscope_layout"
    android:layout_width="150dp"
    android:layout_height="190dp"
    android:layout_above="@+id/rl_bottom_bar"
    android:layout_alignParentEnd="true" />

<RelativeLayout
    android:id="@+id/rl_bottom_bar"
    android:layout_width="match_parent"
    android:layout_height="45dp"
    android:layout_alignParentBottom="true"

    >

    <FrameLayout
        android:id="@+id/bottom_bar_background"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <View
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/topic_detail_bottom_bar_transparent_blark" />
    </FrameLayout>

    <RelativeLayout
        android:id="@+id/rl_primary"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:layout_alignParentBottom="true">

        <ImageView
            android:id="@+id/iv_icon"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_centerVertical="true"
            android:layout_marginLeft="5dp"
            android:background="@drawable/tx_default_avatar"
            android:visibility="visible" />

        <TextView
            android:id="@+id/tv_author"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginStart="5dp"
            android:layout_toEndOf="@+id/iv_icon"
            android:text="昵称"
            android:textColor="@color/text_black"
            android:textSize="16sp"
            android:visibility="visible" />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_alignParentEnd="true"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/iv_chat"
                android:layout_width="35dp"
                android:layout_height="35dp"
                android:layout_gravity="center_vertical"
                android:layout_marginEnd="15dp"
                android:src="@drawable/tx_goods_chat_white"
                android:visibility="gone" />

            <RelativeLayout
                android:id="@+id/rl_display_comment"
                android:layout_width="60dp"
                android:layout_height="match_parent"
                android:layout_marginEnd="10dp">

                <ImageView
                    android:id="@+id/iv_comment"
                    android:layout_width="35dp"
                    android:layout_height="35dp"
                    android:layout_alignParentStart="true"
                    android:layout_centerVertical="true"
                    android:layout_marginEnd="5dp"
                    android:src="@drawable/tx_comment" />

                <TextView
                    android:id="@+id/tv_comment_size"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentEnd="true"
                    android:layout_marginEnd="5dp"
                    android:background="@drawable/tx_red_dot"
                    android:gravity="center"
                    android:paddingStart="5dp"
                    android:paddingEnd="5dp"
                    android:textColor="@color/common_white"
                    android:visibility="invisible" />
            </RelativeLayout>

            <ImageButton
                android:id="@+id/btn_like"
                android:layout_width="35dp"
                android:layout_height="35dp"
                android:layout_gravity="center_vertical"
                android:layout_marginEnd="5dp"
                android:background="@drawable/tx_like"
                android:visibility="visible" />

            <TextView
                android:id="@+id/tv_like_size"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginEnd="5dp"
                android:textColor="@color/common_white"
                android:visibility="invisible" />
        </LinearLayout>

    </RelativeLayout>

</RelativeLayout>

<RelativeLayout
    android:id="@+id/rl_comment"
    android:layout_width="match_parent"
    android:layout_height="45dp"
    android:layout_alignParentBottom="true"
    android:layout_marginTop="5dp"
    android:background="@color/common_bg"
    android:visibility="gone">

    <EditText
        android:id="@+id/et_content"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="5dp"
        android:layout_marginEnd="5dp"
        android:layout_marginBottom="2dp"
        android:layout_toStartOf="@+id/btn_commit"
        android:background="@drawable/tx_edit_text_bg_blue"
        android:minHeight="40dp" />

    <Button
        android:id="@+id/btn_commit"
        android:layout_width="50dp"
        android:layout_height="30dp"
        android:layout_alignParentEnd="true"
        android:layout_centerVertical="true"
        android:layout_marginEnd="5dp"
        android:background="@drawable/tx_bg_btn_transparent"
        android:text="发送" />
</RelativeLayout>

dahai2070 commented 5 years ago

最后复制掉了

dahai2070 commented 5 years ago

dahai2070 commented 5 years ago

输入框 是放一个 RelativeLayout里面,这个RelativeLayout位于根布局的底部, 手机系统是8.0 zuk z2 pro

dahai2070 commented 5 years ago

软件盘弹出来的时候,输入框顶不上去,

dahai2070 commented 5 years ago

问题 解决 , 在setContent ()之后使用 : AndroidBug5497Workaround.assistActivity(this); 下面是这个类的代码 public class AndroidBug5497Workaround {

public static void assistActivity (Activity activity) {
    new AndroidBug5497Workaround(activity);
}

private View mChildOfContent;
private int usableHeightPrevious;
private FrameLayout.LayoutParams frameLayoutParams;

private AndroidBug5497Workaround(Activity activity) {
    FrameLayout content = (FrameLayout) activity.findViewById(android.R.id.content);
    mChildOfContent = content.getChildAt(0);
    mChildOfContent.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
        public void onGlobalLayout() {
            possiblyResizeChildOfContent();
        }
    });
    frameLayoutParams = (FrameLayout.LayoutParams) mChildOfContent.getLayoutParams();
}

private void possiblyResizeChildOfContent() {
    int usableHeightNow = computeUsableHeight();
    if (usableHeightNow != usableHeightPrevious) {
        int usableHeightSansKeyboard = mChildOfContent.getRootView().getHeight();
        int heightDifference = usableHeightSansKeyboard - usableHeightNow;
        if (heightDifference > (usableHeightSansKeyboard/4)) {
            // keyboard probably just became visible
            frameLayoutParams.height = usableHeightSansKeyboard - heightDifference;
        } else {
            // keyboard probably just became hidden
            frameLayoutParams.height = usableHeightSansKeyboard;
        }
        mChildOfContent.requestLayout();
        usableHeightPrevious = usableHeightNow;
    }
}

private int computeUsableHeight() {
    Rect r = new Rect();
    mChildOfContent.getWindowVisibleDisplayFrame(r);
    return (r.bottom - r.top);// 全屏模式下: return r.bottom
}

}

niorgai commented 5 years ago

那天休息的时候看到了..后面就忙忘了..看来和 #22 一样.. 官方 bug 最为致命

niorgai commented 5 years ago

@dahai2070 打扰了, 你的 layout 文件里面有一些自定义的 View, 可以方便给我一个没有自定义 View 的 layout 吗, 我还是想再测试一下..你是第一个给出 layout 的朋友~

dahai2070 commented 5 years ago

<RelativeLayout android:id="@+id/title_bar" android:layout_width="match_parent" android:layout_height="50dp" android:layout_marginTop="20dp" android:background="@color/btn_white_normal">

<ImageView
    android:id="@+id/iv_back"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentStart="true"
    android:layout_centerVertical="true"
    android:layout_marginStart="10dp"
    android:src="@drawable/ease_mm_title_back" />

<com.srbl.mytx.widget.MyTextView
    android:id="@+id/tv_title"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:layout_marginStart="70dp"
    android:gravity="center"
    android:lines="1"
    android:text="我是标题"
    android:textSize="20sp"
    app:colorPosition="1"
    app:endColor="@color/text_black"
    app:startColor="@color/white" />

<com.srbl.mytx.widget.PeriscopeLayout android:id="@+id/periscope_layout" android:layout_width="150dp" android:layout_height="190dp" android:layout_above="@+id/rl_bottom_bar" android:layout_alignParentEnd="true" />

把这几个去掉,这几个跟输入框没关系的

dahai2070 commented 5 years ago

你很负责,值得尊敬。敬礼!

niorgai commented 5 years ago

去掉了之后发现还是布局不太对..好几个根布局了..有空的话还是给个方便测试的完整 layout 吧, 我重新打开它来提醒自己测试一下, 谢谢.

dahai2070 commented 5 years ago

<android.support.v4.widget.NestedScrollView android:id="@+id/sv_container" android:layout_width="match_parent" android:layout_height="wrap_content">

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:weightSum="1">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <TextView
            android:id="@+id/tv_goods_address"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginLeft="5dp"
            android:layout_toRightOf="@+id/iv_goods_location"
            android:text="重庆.渝北区"
            android:visibility="gone" />

        <ImageView
            android:id="@+id/iv_goods_location"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_alignParentLeft="true"
            android:layout_marginLeft="5dp"
            android:src="@drawable/location"
            android:visibility="gone" />

    </RelativeLayout>

    <TextView
        android:id="@+id/tv_goods_description"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="5dp"
        android:text="内容描述"
        android:textSize="16sp" />

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rv_picture_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </android.support.v7.widget.RecyclerView>

    <View
        android:layout_width="match_parent"
        android:layout_height="10dp"
        android:background="@color/gray_background" />

    <android.support.v7.widget.RecyclerView
        android:id="@+id/rv_comment_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </android.support.v7.widget.RecyclerView>

</LinearLayout>

</android.support.v4.widget.NestedScrollView>

<RelativeLayout android:id="@+id/title_bar" android:layout_width="match_parent" android:layout_height="50dp" android:layout_marginTop="20dp" android:background="@color/btn_white_normal">

<ImageView
    android:id="@+id/iv_back"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentStart="true"
    android:layout_centerVertical="true"
    android:layout_marginStart="10dp"
    android:src="@drawable/ease_mm_title_back" />

<RelativeLayout android:id="@+id/rl_bottom_bar" android:layout_width="match_parent" android:layout_height="45dp" android:layout_alignParentBottom="true"

>

<FrameLayout
    android:id="@+id/bottom_bar_background"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <View
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/topic_detail_bottom_bar_transparent_blark" />
</FrameLayout>

<RelativeLayout
    android:id="@+id/rl_primary"
    android:layout_width="match_parent"
    android:layout_height="45dp"
    android:layout_alignParentBottom="true">

    <ImageView
        android:id="@+id/iv_icon"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:layout_centerVertical="true"
        android:layout_marginLeft="5dp"
        android:background="@drawable/tx_default_avatar"
        android:visibility="visible" />

    <TextView
        android:id="@+id/tv_author"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_marginStart="5dp"
        android:layout_toEndOf="@+id/iv_icon"
        android:text="昵称"
        android:textColor="@color/text_black"
        android:textSize="16sp"
        android:visibility="visible" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_alignParentEnd="true"
        android:orientation="horizontal">

        <ImageView
            android:id="@+id/iv_chat"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:layout_gravity="center_vertical"
            android:layout_marginEnd="15dp"
            android:src="@drawable/tx_goods_chat_white"
            android:visibility="gone" />

        <RelativeLayout
            android:id="@+id/rl_display_comment"
            android:layout_width="60dp"
            android:layout_height="match_parent"
            android:layout_marginEnd="10dp">

            <ImageView
                android:id="@+id/iv_comment"
                android:layout_width="35dp"
                android:layout_height="35dp"
                android:layout_alignParentStart="true"
                android:layout_centerVertical="true"
                android:layout_marginEnd="5dp"
                android:src="@drawable/tx_comment" />

            <TextView
                android:id="@+id/tv_comment_size"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_marginEnd="5dp"
                android:background="@drawable/tx_red_dot"
                android:gravity="center"
                android:paddingStart="5dp"
                android:paddingEnd="5dp"
                android:textColor="@color/common_white"
                android:visibility="invisible" />
        </RelativeLayout>

        <ImageButton
            android:id="@+id/btn_like"
            android:layout_width="35dp"
            android:layout_height="35dp"
            android:layout_gravity="center_vertical"
            android:layout_marginEnd="5dp"
            android:background="@drawable/tx_like"
            android:visibility="visible" />

        <TextView
            android:id="@+id/tv_like_size"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginEnd="5dp"
            android:textColor="@color/common_white"
            android:visibility="invisible" />
    </LinearLayout>

</RelativeLayout>

<RelativeLayout android:id="@+id/rl_comment" android:layout_width="match_parent" android:layout_height="45dp" android:layout_alignParentBottom="true" android:layout_marginTop="5dp" android:background="@color/common_bg" android:visibility="gone">

<EditText
    android:id="@+id/et_content"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="5dp"
    android:layout_marginEnd="5dp"
    android:layout_marginBottom="2dp"
    android:layout_toStartOf="@+id/btn_commit"
    android:background="@drawable/tx_edit_text_bg_blue"
    android:minHeight="40dp" />

<Button
    android:id="@+id/btn_commit"
    android:layout_width="50dp"
    android:layout_height="30dp"
    android:layout_alignParentEnd="true"
    android:layout_centerVertical="true"
    android:layout_marginEnd="5dp"
    android:background="@drawable/tx_bg_btn_transparent"
    android:text="发送" />

这样的

dahai2070 commented 5 years ago

好像还是 不完整,等我重新发

dahai2070 commented 5 years ago

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/common_bg" android:orientation="vertical" tools:context="com.srbl.mytx.activity.TopicDetailsActivity">

<android.support.v4.widget.NestedScrollView
    android:id="@+id/sv_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:weightSum="1">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/tv_goods_address"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="5dp"
                android:layout_toRightOf="@+id/iv_goods_location"
                android:text="重庆.渝北区"
                android:visibility="gone" />

            <ImageView
                android:id="@+id/iv_goods_location"
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_alignParentLeft="true"
                android:layout_marginLeft="5dp"
                android:src="@drawable/location"
                android:visibility="gone" />

        </RelativeLayout>

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_picture_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </android.support.v7.widget.RecyclerView>

        <TextView
            android:id="@+id/tv_goods_description"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:text="内容描述"
            android:textSize="16sp" />

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/gray_background" />

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_comment_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </android.support.v7.widget.RecyclerView>

    </LinearLayout>

</android.support.v4.widget.NestedScrollView>

    <RelativeLayout
        android:id="@+id/title_bar"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="@color/btn_white_normal">

        <ImageView
            android:id="@+id/iv_back"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_centerVertical="true"
            android:layout_marginStart="10dp"
            android:src="@drawable/ease_mm_title_back" />

        <TextView
            android:id="@+id/tv_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_marginStart="70dp"
            android:gravity="center"
            android:lines="1"
            android:text="我是标题"
            android:textSize="20sp"
             />
    </RelativeLayout>

<RelativeLayout
    android:id="@+id/rl_bottom_bar"
    android:layout_width="match_parent"
    android:layout_height="45dp"
    android:layout_alignParentBottom="true"
    >

    <RelativeLayout
        android:id="@+id/rl_comment"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:layout_alignParentBottom="true"
        android:layout_marginTop="5dp"
        android:background="@color/common_bg"
        android:visibility="visible">

        <EditText
            android:id="@+id/et_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="5dp"
            android:layout_marginEnd="5dp"
            android:layout_marginBottom="2dp"
            android:layout_toStartOf="@+id/btn_commit"
            android:background="@drawable/tx_edit_text_bg_blue"
            android:minHeight="40dp" />

        <Button
            android:id="@+id/btn_commit"
            android:layout_width="50dp"
            android:layout_height="30dp"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="5dp"
            android:background="@drawable/tx_bg_btn_transparent"
            android:text="发送" />
    </RelativeLayout>
</RelativeLayout>

dahai2070 commented 5 years ago

是github 评论的原因,文件太长了 把头部给去掉了,接下来,我分两部分发

dahai2070 commented 5 years ago

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/common_bg" android:orientation="vertical" tools:context="com.srbl.mytx.activity.TopicDetailsActivity">

<android.support.v4.widget.NestedScrollView
    android:id="@+id/sv_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:weightSum="1">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/tv_goods_address"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="5dp"
                android:layout_toRightOf="@+id/iv_goods_location"
                android:text="重庆.渝北区"
                android:visibility="gone" />

            <ImageView
                android:id="@+id/iv_goods_location"
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_alignParentLeft="true"
                android:layout_marginLeft="5dp"
                android:src="@drawable/location"
                android:visibility="gone" />

        </RelativeLayout>

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_picture_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </android.support.v7.widget.RecyclerView>

        <TextView
            android:id="@+id/tv_goods_description"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:text="内容描述"
            android:textSize="16sp" />

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/gray_background" />

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_comment_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </android.support.v7.widget.RecyclerView>

    </LinearLayout>

</android.support.v4.widget.NestedScrollView>

    <RelativeLayout
        android:id="@+id/title_bar"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="@color/btn_white_normal">

        <ImageView
            android:id="@+id/iv_back"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_centerVertical="true"
            android:layout_marginStart="10dp"
            android:src="@drawable/ease_mm_title_back" />

        <TextView
            android:id="@+id/tv_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_marginStart="70dp"
            android:gravity="center"
            android:lines="1"
            android:text="我是标题"
            android:textSize="20sp"
             />
    </RelativeLayout>
dahai2070 commented 5 years ago

啊,,头部还是被去掉了。。。

dahai2070 commented 5 years ago

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/common_bg" android:orientation="vertical" tools:context="com.srbl.mytx.activity.TopicDetailsActivity">

<android.support.v4.widget.NestedScrollView
    android:id="@+id/sv_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:weightSum="1">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/tv_goods_address"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="5dp"
                android:layout_toRightOf="@+id/iv_goods_location"
                android:text="重庆.渝北区"
                android:visibility="gone" />

            <ImageView
                android:id="@+id/iv_goods_location"
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_alignParentLeft="true"
                android:layout_marginLeft="5dp"
                android:src="@drawable/location"
                android:visibility="gone" />

        </RelativeLayout>

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_picture_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </android.support.v7.widget.RecyclerView>

        <TextView
            android:id="@+id/tv_goods_description"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:text="内容描述"
            android:textSize="16sp" />

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/gray_background" />

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_comment_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </android.support.v7.widget.RecyclerView>

    </LinearLayout>

</android.support.v4.widget.NestedScrollView>

    <RelativeLayout
        android:id="@+id/title_bar"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="@color/btn_white_normal">

        <ImageView
            android:id="@+id/iv_back"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_centerVertical="true"
            android:layout_marginStart="10dp"
            android:src="@drawable/ease_mm_title_back" />

        <TextView
            android:id="@+id/tv_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_marginStart="70dp"
            android:gravity="center"
            android:lines="1"
            android:text="我是标题"
            android:textSize="20sp"
             />
    </RelativeLayout>

<RelativeLayout
    android:id="@+id/rl_bottom_bar"
    android:layout_width="match_parent"
    android:layout_height="45dp"
    android:layout_alignParentBottom="true"
    >

    <RelativeLayout
        android:id="@+id/rl_comment"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:layout_alignParentBottom="true"
        android:layout_marginTop="5dp"
        android:background="@color/common_bg"
        android:visibility="visible">

        <EditText
            android:id="@+id/et_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="5dp"
            android:layout_marginEnd="5dp"
            android:layout_marginBottom="2dp"
            android:layout_toStartOf="@+id/btn_commit"
            android:background="@drawable/tx_edit_text_bg_blue"
            android:minHeight="40dp" />

        <Button
            android:id="@+id/btn_commit"
            android:layout_width="50dp"
            android:layout_height="30dp"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="5dp"
            android:background="@drawable/tx_bg_btn_transparent"
            android:text="发送" />
    </RelativeLayout>
</RelativeLayout>

niorgai commented 5 years ago

创建一个 gist 文件吧..

dahai2070 commented 5 years ago

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/common_bg" android:orientation="vertical" tools:context="com.srbl.mytx.activity.TopicDetailsActivity">

dahai2070 commented 5 years ago

`<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/common_bg" android:orientation="vertical" tools:context="com.srbl.mytx.activity.TopicDetailsActivity">

<android.support.v4.widget.NestedScrollView
    android:id="@+id/sv_container"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:weightSum="1">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/tv_goods_address"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_marginLeft="5dp"
                android:layout_toRightOf="@+id/iv_goods_location"
                android:text="重庆.渝北区"
                android:visibility="gone" />

            <ImageView
                android:id="@+id/iv_goods_location"
                android:layout_width="30dp"
                android:layout_height="30dp"
                android:layout_alignParentLeft="true"
                android:layout_marginLeft="5dp"
                android:src="@drawable/location"
                android:visibility="gone" />

        </RelativeLayout>

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_picture_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </android.support.v7.widget.RecyclerView>

        <TextView
            android:id="@+id/tv_goods_description"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="5dp"
            android:text="内容描述"
            android:textSize="16sp" />

        <View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="@color/gray_background" />

        <android.support.v7.widget.RecyclerView
            android:id="@+id/rv_comment_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

        </android.support.v7.widget.RecyclerView>

    </LinearLayout>

</android.support.v4.widget.NestedScrollView>

    <RelativeLayout
        android:id="@+id/title_bar"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:background="@color/btn_white_normal">

        <ImageView
            android:id="@+id/iv_back"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_centerVertical="true"
            android:layout_marginStart="10dp"
            android:src="@drawable/ease_mm_title_back" />

        <TextView
            android:id="@+id/tv_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_marginStart="70dp"
            android:gravity="center"
            android:lines="1"
            android:text="我是标题"
            android:textSize="20sp"
             />
    </RelativeLayout>

<RelativeLayout
    android:id="@+id/rl_bottom_bar"
    android:layout_width="match_parent"
    android:layout_height="45dp"
    android:layout_alignParentBottom="true"
    >

    <RelativeLayout
        android:id="@+id/rl_comment"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:layout_alignParentBottom="true"
        android:layout_marginTop="5dp"
        android:background="@color/common_bg"
        android:visibility="visible">

        <EditText
            android:id="@+id/et_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="5dp"
            android:layout_marginEnd="5dp"
            android:layout_marginBottom="2dp"
            android:layout_toStartOf="@+id/btn_commit"
            android:background="@drawable/tx_edit_text_bg_blue"
            android:minHeight="40dp" />

        <Button
            android:id="@+id/btn_commit"
            android:layout_width="50dp"
            android:layout_height="30dp"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="5dp"
            android:background="@drawable/tx_bg_btn_transparent"
            android:text="发送" />
    </RelativeLayout>
</RelativeLayout>

`

dahai2070 commented 5 years ago

他妈的,还是不行,我试试你说的

dahai2070 commented 5 years ago

我加你QQ 我的是274981914

niorgai commented 5 years ago

刚加了 你看下

niorgai commented 5 years ago

已添加说明