将框架布局放在相对布局下面

时间:2018-04-25 12:38:22

标签: android android-layout android-framelayout

我正试图解决这个问题,但是'我卡住了。

问题:

我想将框架布局放在相对布局下面。

FrameLayout =表情符号 相对布局=带有edittext的容器

我希望当我点击微笑按钮时,framelayout会显示在edittext上方。

但是我不能这样做。除了这个以外,转换工作正常。

图片:

Like i need

错误:

Error

我正在使用此代码

<!--Container FrameLayout-->
                <FrameLayout
                    android:id="@+id/keyboard_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"/>

                <!--Container Emoticon Edittext-->
                <RelativeLayout
                    android:id="@+id/bottom_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_marginBottom="@dimen/edt_msg_content_margin"
                    android:layout_marginLeft="@dimen/edt_msg_content_margin"
                    android:layout_marginStart="@dimen/edt_msg_content_margin"
                    android:layout_toLeftOf="@+id/btn_send_message"
                    android:layout_toStartOf="@+id/btn_send_message"
                    android:background="@drawable/message_item_background"
                    android:layout_above="@id/keyboard_container"
                    android:elevation="4dp"
                    android:paddingBottom="@dimen/edt_msg_content_padding_v"
                    android:paddingLeft="@dimen/edt_msg_content_padding_h"
                    android:paddingRight="@dimen/edt_msg_content_padding_h"
                    android:paddingTop="@dimen/edt_msg_content_padding_v">

                    <ImageView
                        android:id="@+id/botao_emoji"
                        android:layout_width="@dimen/edt_ic_size"
                        android:layout_height="@dimen/edt_ic_size"
                        android:layout_alignParentLeft="true"
                        android:layout_alignParentStart="true"
                        android:layout_centerVertical="true"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:padding="4dp"
                        app:srcCompat="@drawable/chat_emoticon"
                        android:tint="@color/green_600"/>


                    <!--<hani.momanii.supernova_emoji_library.Helper.EmojiconEditText-->
                    <com.kevalpatel2106.emoticongifkeyboard.widget.EmoticonEditText
                        android:id="@+id/edt_message_content"
                        style="@style/Base.TextAppearance.AppCompat.Medium"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_toLeftOf="@+id/iv_camera"
                        android:layout_toStartOf="@+id/iv_camera"
                        android:background="#00ffffff"
                        android:hint="Digite sua mensagem!"
                        android:inputType="textMultiLine|textCapSentences|textNoSuggestions"
                        android:lines="2"
                        android:maxLines="3"
                        android:layout_toRightOf="@+id/botao_emoji"
                        android:layout_toEndOf="@+id/botao_emoji"/>

                    <ImageButton
                        android:id="@+id/message_love_button"
                        android:layout_width="@dimen/edt_ic_size"
                        android:layout_height="@dimen/edt_ic_size"
                        android:layout_alignParentEnd="true"
                        android:layout_alignParentRight="true"
                        android:layout_centerVertical="true"
                        android:background="?attr/selectableItemBackgroundBorderless"
                        android:padding="4dp"
                        app:srcCompat="@drawable/ic_love_animation"
                        android:tint="@color/red_400"/>

                </RelativeLayout>

谢谢!

1 个答案:

答案 0 :(得分:1)

删除

android:layout_alignParentBottom="true"

从相对布局......