Android Studio 2.0(预览版 3b)布局 xml 更改未在 apk 中更新?

标签 android android-layout instant-run android-studio-2.0

当我对布局资源文件进行更改时,当从 Android Studio 2.0(预览版 3b)构建和安装 apk 文件时,它不会更新/反射(reflect)出来。

例子: 我有一个 EditText 并且添加了一个 TextInputLayout,如下所示:

<android.support.design.widget.TextInputLayout
    android:id="@+id/input_layout_new_password"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp">

    <EditText
        android:id="@+id/edit_text_new_password"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/hint_your_new_password"
        android:inputType="textPassword"
        android:saveEnabled="false" />

</android.support.design.widget.TextInputLayout>

更新应用程序后的结果与我添加 TextInputLayout 之前的结果相同,只是没有 TextInputLayoutEditText

我尝试过的:

  • 构建/清理项目
  • build /重建项目
  • 文件/使缓存无效/重新启动..
  • 先卸载应用
  • 关闭即时运行

我怀疑这可能是 Android Studio 2.0 Preview 3b 版本的错误导致的。有任何想法吗?也许它只是一个设置/配置?

最佳答案

临时解决方案: 如果您制作布局文件的副本并将其扩充。然后更改在应用程序中更新?但这不是理想的最佳解决方案!

关于Android Studio 2.0(预览版 3b)布局 xml 更改未在 apk 中更新?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34307428/

相关文章:

java - 如何监控 Activity 类之外的 Activity 的生命周期

安卓 ViewAnimator : animation while changing viewstub child

Android Studio 在布局预览中显示错误的布局(ActionBarOverlayLayout?!)

android - 在 Android Studio 2.0 中即时运行(如何关闭)

android - 为什么我在 Android 上无法检测到带有 unicode 字符的 wifi SSID?

java - 无法实例化接收器 GCMBroadcastReceiver

android - 在Xamarin.Android中设置RelativeLayout的背景颜色

android - 运行使用 Gradle2.0.0-alpha 插件编译的 Android(用 Kotlin 编写)项目时出错

android - Volley 不适用于 Gradle 2.0 和 Instant run

java - .get() 和 .put() 方法从 Eclipse 迁移到 Android Studio