我正在尝试很长时间但没有成功,每次当我在编辑文本中包装线时,聊天变得隐蔽......我不知道为什么会发生这种情况。
我删除旧文件并使用新的xml代码再次写入,但我无法找到问题。
我正在使用SlidingUpPanelLayout,但我不认为这是问题..
高度是android:layout_height="wrap_content"
中的换行内容edittext
,而recyclerview
中的换行内容matchparent
有人可以帮我解决这个问题吗?
谢谢!
<?xml version="1.0" encoding="utf-8"?>
<com.sothree.slidinguppanel.SlidingUpPanelLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:sothree="http://schemas.android.com/apk/res-auto"
android:id="@+id/sliding_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
sothree:umanoPanelHeight="68dp"
android:background="#FFFFFF"
sothree:umanoShadowHeight="4dp"
sothree:umanoParallaxOffset="100dp"
sothree:umanoDragView="@+id/dragView"
sothree:umanoOverlay="false"
sothree:umanoScrollableView="@+id/list">
<!-- MAIN CONTENT -->
<!--android:background="@drawable/fundo_chat"-->
<!--android:background="@color/white"-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!--##################################### HERE IS RECYCLE VIEW LAYOUT ############################### -->
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view_chat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="@+id/layout_envio_msg"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="@drawable/telegramfundo_chat"
android:paddingBottom="50dp"
app:layoutManager="LinearLayoutManager" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentEnd="true"
android:layout_marginBottom="80dp"
android:layout_marginRight="15dp"
android:backgroundTint="#FFFFFF"
android:src="@drawable/indicador_msg_whats"
android:visibility="visible"
app:borderWidth="0dp"
app:elevation="5dp"
app:fabSize="mini" />
<!--##################################### HERE IS RECYCLE VIEW LAYOUT ############################### -->
<!--##################################### HERE IS EDIT TEXT LAYOUT ############################### -->
<LinearLayout
android:layout_width="350dp"
android:layout_height="wrap_content"
android:background="@drawable/chat_mensagem_fundocontrolbg"
android:orientation="horizontal"
android:id="@+id/layout_envio_msg"
android:visibility="visible"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="3dp">
<ImageButton
android:id="@+id/botao_emoji"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignTop="@+id/botao_hash"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:background="@color/Transparent"
android:paddingTop="7dp"
android:src="@drawable/emotion_chat"
android:tint="#1673fd"></ImageButton>
<ImageButton
android:id="@+id/botao_hash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/edit_text_message"
android:layout_marginLeft="7dp"
android:layout_marginStart="7dp"
android:layout_toEndOf="@+id/botao_emoji"
android:layout_toRightOf="@+id/botao_emoji"
android:background="@color/Transparent"
android:paddingTop="7dp"
android:src="@drawable/search_hashtag_chat"
android:tint="#d40040"></ImageButton>
<hani.momanii.supernova_emoji_library.Helper.EmojiconEditText
android:id="@+id/edit_text_message"
android:layout_width="220dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toEndOf="@+id/botao_hash"
android:layout_toRightOf="@+id/botao_hash"
android:hint="Digite uma mensagem..."
android:overScrollMode="always"
android:padding="@dimen/padding_small"
android:scrollbarStyle="insideInset"
android:scrollbars="vertical"
android:textAlignment="center"
android:textSize="17sp" />
<ImageButton
android:id="@+id/botao_mic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/edit_text_message"
android:layout_toEndOf="@+id/edit_text_message"
android:layout_toRightOf="@+id/edit_text_message"
android:background="@color/Transparent"
android:paddingTop="7dp"
android:src="@drawable/chat_record"
android:tint="#006909"></ImageButton>
<ImageButton
android:id="@+id/botao_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/botao_mic"
android:layout_marginLeft="9dp"
android:layout_marginStart="9dp"
android:layout_toEndOf="@+id/botao_mic"
android:layout_toRightOf="@+id/botao_mic"
android:background="@color/Transparent"
android:paddingTop="7dp"
android:src="@drawable/send_chat"
android:tint="#1f4374"></ImageButton>
</LinearLayout>
<!--##################################### HERE IS EDIT TEXT LAYOUT ############################### -->
<RelativeLayout
android:id="@+id/youtube_fragment_layout"
android:layout_width="230dp"
android:layout_height="135dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="200dp"
android:background="@drawable/rounded_rect_bg_action_down"
android:clickable="true"
android:visibility="invisible">
<FrameLayout
android:id="@+id/youtube_fragment"
android:layout_width="200dp"
android:layout_height="110dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:background="@drawable/rounded_rect_bg_action_down"
android:clickable="true"
android:visibility="visible" />
<!--<fragment-->
<!--android:name="com.google.android.youtube.player.YouTubePlayerSupportFragment"-->
<!--android:id="@+id/youtube_fragment"-->
<!--android:layout_width="150dp"-->
<!--android:layout_height="100dp"-->
<!--android:layout_marginTop="100dp"-->
<!--android:layout_centerHorizontal="true"-->
<!--android:visibility="visible" />-->
<ImageButton
android:id="@+id/btn_Grab"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_above="@+id/youtube_fragment"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/youtube_fragment"
android:layout_toRightOf="@+id/youtube_fragment"
android:background="@color/Transparent"
app:srcCompat="@drawable/grab_video" />
</RelativeLayout>
<FrameLayout
android:id="@+id/typing_frame"
android:layout_width="70dp"
android:layout_height="16dp"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="520dp"
android:background="@drawable/rounded_rect_bg_action_down_typing"
android:textAlignment="center"
android:visibility="visible">
<TextView
android:id="@+id/typing_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Digitando..."
android:textAlignment="center"
android:textSize="10sp"
android:textStyle="bold|italic" />
</FrameLayout>
</RelativeLayout>
<!-- SLIDING LAYOUT -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:clickable="true"
android:focusable="false"
android:id="@+id/dragView">
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="68dp"-->
<!--android:orientation="horizontal">-->
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:backgroundTint="@color/amber_400"-->
<!--android:layout_height="68dp">-->
<!--<TextView-->
<!--android:id="@+id/name"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="match_parent"-->
<!--android:layout_weight="1"-->
<!--android:textSize="14sp"-->
<!--android:gravity="center_vertical"-->
<!--android:paddingLeft="10dp"/>-->
<!--<Button-->
<!--android:id="@+id/follow"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="match_parent"-->
<!--android:textSize="14sp"-->
<!--android:gravity="center_vertical|right"-->
<!--android:paddingRight="10dp"-->
<!--android:paddingLeft="10dp"/>-->
<!--</LinearLayout>-->
<!--</LinearLayout>-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="68dp"
android:background="#2d5d82"
android:id="@+id/Painel_Informacao"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="68dp">
<TextView
android:id="@+id/Nome_Video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="120dp"
android:layout_marginStart="120dp"
android:maxLength="25"
android:ellipsize="marquee"
android:focusable="true"
android:textStyle="bold"
android:focusableInTouchMode="true"
android:singleLine="true"
android:layout_marginTop="05dp"
android:text="Aguardando..."
android:textColor="@color/white" />
<TextView
android:id="@+id/TempoCorrido"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Aguardando..."
android:textColor="@color/yellow_600"
android:textSize="11sp"
android:maxLength="30"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:singleLine="true"
android:textStyle="bold"
android:layout_marginLeft="120dp"
android:layout_marginTop="50dp"
/>
<TextView
android:id="@+id/Duracao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Aguardando..."
android:textColor="@color/white"
android:textSize="11sp"
android:maxLength="30"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:singleLine="true"
android:textStyle="bold"
android:layout_marginLeft="120dp"
android:layout_marginTop="30dp" />
<ImageButton
android:id="@+id/Botao_Compartlilhar_Video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/Transparent"
app:srcCompat="@drawable/sharev"
android:layout_marginLeft="250dp"
android:layout_marginTop="33dp"
/>
<ImageButton
android:id="@+id/Botao_Compartlilhar_Video_Amigo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/Transparent"
app:srcCompat="@drawable/video_friend"
android:layout_marginLeft="290dp"
android:layout_marginTop="33dp"
/>
<ImageButton
android:id="@+id/Botao_Desligar_Video"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="330dp"
android:layout_marginTop="33dp"
android:background="@color/Transparent"
app:srcCompat="@drawable/offv" />
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="100dp"
android:layout_height="70dp"
android:layout_marginLeft="5dp"
android:background="@color/Transparent"
android:clickable="true"
card_view:cardBackgroundColor="@android:color/black"
card_view:cardCornerRadius="5dp"
card_view:cardElevation="0dp"
card_view:cardPreventCornerOverlap="false"
card_view:cardUseCompatPadding="true">
<ImageView
android:id="@+id/youtube_thumbnail"
android:layout_width="100dp"
android:layout_height="70dp"
android:src="@drawable/youtube_miniplay"
android:scaleType="centerInside"
android:visibility="visible" />
</android.support.v7.widget.CardView>
</RelativeLayout>
</RelativeLayout>
<ScrollView
android:id="@+id/sv"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<FrameLayout
android:id="@+id/Conteudo_Dinamico"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</ScrollView>
<!--<TextView-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:text="The standard Lorem Ipsum passage, used since the 1500Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Section 1.10.32 of written by Cicero in 45 t perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?1914 translation by H. RackhamBut I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete accouof the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure?At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat."/>-->
<!--</ScrollView>-->
</LinearLayout>
答案 0 :(得分:0)
根据我对您的问题的理解,您希望您的recyclerview(实际聊天所在的位置)显示在编辑文本上方。那么如何将您的Recyclerview更改为:
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view_chat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/layout_envio_msg"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:background="@drawable/telegramfundo_chat"
android:paddingBottom="50dp"
app:layoutManager="LinearLayoutManager" />
我做的是以下内容;我删除了对齐的父母底部。因为这会将它与@+id/layout_envio_msg
的底部对齐,我明白你希望它出现在上面。所以我用android:layout_above="@+id/layout_envio_msg"
未来问题的小提示:尝试仅添加相关代码。太多不相关的代码可能会令人困惑,因为我们无法理解您所有代码的特定用例。
〜问候