【问题标题】:Android Studio, overlapping text with Project NameAndroid Studio,与项目名称重叠的文本
【发布时间】:2016-03-06 03:54:37
【问题描述】:

我刚开始在 mac 上进行 Android 开发。我只是在 content_main.xml 中编写了这段代码。这里的代码是重叠的。

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="Enter Your Name"
    android:layout_marginBottom="8dp"
    android:id="@+id/activity_main_name" />
<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Confirm Name"
    android:onClick="confirmName"/>

寻求真诚的帮助。在此先感谢:)

【问题讨论】:

  • 你附上图片了吗?看不到。
  • 你确定你有 (View v) 作为你在点击时调用的方法的参数吗?
  • @Mohammad - 我想我知道问题所在,但我们需要查看图像。它没有正确连接。
  • @Mohammad 也发布您的 activity_main.xml 文件

标签: android xml android-studio android-linearlayout


【解决方案1】:

没有看到图像,我相信这会解决您的问题。我认为工具栏覆盖了您的 EditText

将这两行代码输入到LinearLayout块中。

 xmlns:app="http://schemas.android.com/apk/res-auto"
app:layout_behavior="@string/appbar_scrolling_view_behavior"

LinearLayout 块现在应该如下所示。

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">

【讨论】:

    猜你喜欢
    • 2015-04-18
    • 2015-03-23
    • 1970-01-01
    • 2015-02-28
    • 2013-08-19
    • 2020-10-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多