小编May*_*tel的帖子

Gradle KTS构建文件

Google发布了更新版本的Android Studio 3.5。更新到此版本后,我在下面收到此警告:

This project uses Gradle KTS build files which are not fully supported. 
Some functions may be affected.
Run Code Online (Sandbox Code Playgroud)

但是,我相信此警告仅限于使用Gradle的Kotlin DSL管理其依赖项的开发人员。而不是使用常规脚本

android android-studio gradle-kotlin-dsl

15
推荐指数
1
解决办法
1215
查看次数

1 个文件被跳过,因为没有节省空间

我正在尝试将 PNG 图像文件转换为 webP 图像文件。但即使我的应用程序 minSdkVersion>19 也给我一个错误,但我不知道为什么它给我这样的错误

0 files were converted 

1 files were skipped because there was no net space savings
Run Code Online (Sandbox Code Playgroud)

android image android-image webp

7
推荐指数
1
解决办法
1251
查看次数

在重新排列/重新格式化(命令+ ALT + L)代码的同时,在Android Studio中设计标签顺序更改

在更新我的android studio之前,我的代码使用重新排列/重新格式化(command + ALT + L)看起来像这样

许多用户在这里报告了此问题

https://issuetracker.google.com/issues?q=Ctrl%2BAlt%2BL

https://issuetracker.google.com/issues/139769915

重新格式化代码的快捷方式

Windows:Ctrl + Alt + L

Linux:Ctrl + Shift + Alt + L

macOS:Option + Command + L

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:fitsSystemWindows="true"
    tools:context=".view.activity.UserFollowingActivity">

    <data>

        <variable
            name="viewModel"
            type="com.socket.chat.viewmodel.ConversionListVM" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>
Run Code Online (Sandbox Code Playgroud)

但是在更新android studio之后,我的代码顺序改变了,而重新排列/重新格式化(command + ALT + L)代码

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:fitsSystemWindows="true"
    tools:context=".view.activity.UserFollowingActivity">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    </androidx.constraintlayout.widget.ConstraintLayout>

    <data>

        <variable
            name="viewModel"
            type="com.socket.chat.viewmodel.ConversionListVM" />
    </data>
</layout>
Run Code Online (Sandbox Code Playgroud)

在每个设计XML文件和AndroidManifest.xml文件中均对其进行了更改。

那么如何用旧方法做到这一点呢?

android android-layout android-studio

5
推荐指数
1
解决办法
332
查看次数

什么是 kotlin 中的内联类?

内联类:内联类

我想知道内联与 kotlin 中其他类的确切区别是什么?我想知道确切的内联类是做什么的以及我们什么时候使用它?

android kotlin

4
推荐指数
1
解决办法
1331
查看次数