android - 添加安卓 :id to xml breaks entire app

标签 android android-layout android-xml

我有这个 XML 文件:

<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent">
    <Button android:text="Disable Filter" android:background="@drawable/buttons" style="@style/ButtonText" android:layout_weight="25" />
    <ImageView android:id="@+id/imageFilter" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="75" />
    <HorizontalScrollView android:layout_width="fill_parent" android:layout_height="wrap_content">
        <LinearLayout android:id="@+id/horizontal" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="fill_parent">
        </LinearLayout>
    </HorizontalScrollView>
</LinearLayout>

只要我将 android:id="@+id/btnFilterPreview" 添加到 Button 我的应用程序就会停止工作。这是为什么?

最佳答案

在 Netbeans 中解决问题,右键单击项目并选择:Clean and Build

关于android - 添加安卓 :id to xml breaks entire app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13223388/

相关文章:

android - 在线性布局中对齐和包装图像按钮

android - 调试主屏幕小部件时,调试器在 Android Studio 中断开连接

android - android 中 scrollTo() 的问题

android - 使用 xmpp 传输文件时出现错误代码 503

android - 膨胀类 android.support.v7.internal.widget.ActionBarView 时出错

android - 在日历 View 中更改当天的文本颜色

java - 在运行时将数据分配给四维数组

android - 不推荐使用 defaultDisplay : Display! 的 Getter。在 Java 中已弃用

android.widget.Scrollview 无法转换为 android.widget.Linearlayout

android - 工具栏在 Intent/AppCompatActivity 中的菜单膨胀时给出 fatal error