【发布时间】:2017-08-25 13:08:04
【问题描述】:
我有下面的FrameLayout,这个布局是用来给我的RecyclerView 做行的。在蚀刻行中,我有文本框和复选框。问题是复选框和文本框相互连接,文本顶部的复选框隐藏了文本框。
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
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="56dp"
android:focusable="false"
>
<Button
android:id="@+id/undo_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_undo"
android:textAllCaps="true"
android:textColor="@android:color/white"
android:layout_gravity="end|center_vertical"
style="@style/Base.Widget.AppCompat.Button.Borderless"
/>
<!-- quick and dirty divider -->
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray"
android:layout_gravity="bottom"
/>
<TextView
android:id="@+id/title_text_view"
android:layout_width="323dp"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:allowUndo="true"
android:elevation="0dp"
android:gravity="center_vertical"
android:textSize="16sp"
android:textStyle="bold" />
<CheckBox
android:id="@+id/CheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</FrameLayout>
如果有人能帮我解决这个问题,我会很高兴。谢谢。
【问题讨论】:
-
你能分享屏幕截图吗?
-
复选框有一个内置的 android:text 元素。你不能用吗?
-
@Nabil 这次我用不了了。
-
@JaiminPrajapti 我添加了一个屏幕截图。
-
你能展示你想要实现的设计吗?
标签: android xml android-layout user-interface