小编Aka*_*min的帖子

传统 Android ViewPager 中 LazyRow 的滚动问题

使用 jetpack compose 互操作性 API 时,在预构建的 ViewPager 中使用 LazyRow 会导致滚动问题。

当尝试滚动 LazyRow 内的项目时,ViewPager 会移动。我们有什么办法可以防止这种情况发生吗?

撰写视图

<androidx.compose.ui.platform.ComposeView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/compose_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />
Run Code Online (Sandbox Code Playgroud)

在片段中设置视图

binding.composeView.setContent {
    HorizontalScrollableView(listOfCards)
}
Run Code Online (Sandbox Code Playgroud)

以及用 compose 编写的视图

@Composable
fun HorizontalScrollableView(listOfCards: List<Cards>) {
    Column(
        modifier = Modifier
            .background(color = colorResource(R.color.grey10))
    ) {
        Text(
            text = "Items",
            color = colors.primary,
            style = typography.subheadBold,
            fontSize = 15.sp,
            modifier = Modifier.padding(start = 16.dp, top = 10.dp, end = 16.dp)
        )
        LazyRow(contentPadding = PaddingValues(end = 16.dp)) {
            items(
                items = listOfCards,
                key …
Run Code Online (Sandbox Code Playgroud)

android android-viewpager android-jetpack android-jetpack-compose

13
推荐指数
1
解决办法
1810
查看次数

Visual Studio 2015运行aapt.exe进程使用100%的CPU使用率

我正在使用visual studio 2015 update 2社区版来构建Xamarin应用程序.当我添加一个新的nuget包或更新我现有的包时,aapt.exe进程会打开,它使用100%的CPU.它让我等待很长时间才能完成nuget包的安装.任何人都面临同样的问题.对此的解决方案非常感谢.

cpu-usage nuget-package xamarin visual-studio-2015

9
推荐指数
2
解决办法
1595
查看次数

以下软件包不可用: - 软件包ID lldb; 3.0 - Android Studio 3.0

我尝试调试应用程序时收到此错误.我已尝试过此链接中提到的步骤,但它们不起作用.我正在使用Windows.

Android Studio 2.2.2 LLDB 2.2更新问题

我检查了SDK工具,没有LLDB的更新.还尝试删除现有的LLDB文件夹并重新安装.它需要3.0版本,但无处可寻.

android android-studio-3.0

8
推荐指数
1
解决办法
2279
查看次数

将GestureRecognizer添加到gridview中的行

我有一个网格,其中有3列包含2个按钮和1个标签.我想要的是为网格中的每一行添加一个Tap手势.我希望当用户点击网格行中的任何位置时触发click事件.有没有办法做到这一点?

我想让我的布局尽可能简单.在我使用多个stacklayout创建相同的网格并向父stacklayout添加手势之前.但是为了性能,我想使用网格视图来做到这一点.

xamarin xamarin.forms

7
推荐指数
2
解决办法
6443
查看次数

InputTransparent = true在Xamarin Forms Android中不起作用

这个链接.

如果元素应该接收输入,则为false; 如果元素不应该接收输入,则应该为true,而应将输入传递给下面的元素.默认值为false.

我想要的是,不允许Entry字段接收来自用户的输入.

InputTransparent=true 在iOS中运行良好但在Android中不起作用,它仍然允许用户提供输入.

我试过IsEnabled=false但是这改变了我的Entry字段的外观,我不希望这样.

这是某种错误吗?

xamarin.ios xamarin.android xamarin

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

前台协程工作程序导致 android.app.RemoteServiceException:Context.startForegroundService() 没有调用 Service.startForeground()

协程工作线程发生以下崩溃,该崩溃仅发生在某些 Samsung、Vivo 和 Oppo 设备上,特别是 Android 10 上

Fatal Exception: android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{2dcabaa u0 `app_id_hidden`/androidx.work.impl.foreground.SystemForegroundService}
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2159)
       at android.os.Handler.dispatchMessage(Handler.java:107)
       at android.os.Looper.loop(Looper.java:230)
       at android.app.ActivityThread.main(ActivityThread.java:7752)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:526)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034)
Run Code Online (Sandbox Code Playgroud)

doWork工作人员的功能被实现为,该功能init()完成我的工作。

override suspend fun doWork(): Result {
    setForeground(createForegroundInfo())
    return init()
}

private fun init() {
    //implementation hidden
}

private fun createForegroundInfo(): ForegroundInfo {
    val notificationId = 1
    return ForegroundInfo(notificationId, createNotification())
}

private fun createNotification(): Notification {
    val context = applicationContext

    val builder = …
Run Code Online (Sandbox Code Playgroud)

android android-workmanager kotlin-coroutines

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

无法解析程序集:'Java.Interop'

当我尝试构建应用程序时,我得到以下异常的异常:

C:\ Program Files(x86)\ MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(681,3):错误:无法解析程序集:'Java.Interop,Version = 0.1.0.0,Culture = neutral,公钥= 84e04ff9cfb79065'

我尝试清理项目并再次构建它,还更新了Xamarin.Forms包,但仍然没有运气.

关于堆栈跟踪的一点概述:

2> C:\ Program Files(x86)\ MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(681,3):错误:无法解析程序集:'Java.Interop,Version = 0.1.0.0,Culture =中性,PublicKeyToken = 84e04ff9cfb79065'2> Tool /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch执行完毕.(TaskId:153)2> MTouch:2016-07-05T14:27:15.8191415 + 05:30 - 已完成(TaskId:153)2>输出项目:_NativeLibrary =(TaskId:153)2>完成执行任务" MTouch" - 失败.(TASKID:153)

有没有人收到此错误?我正在为Visual Studio运行最新的Xamarin.

msbuild xamarin.ios xamarin

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

链接SDK和用户程序集后,JsonConvert.DeserializeObjects不起作用

当将链接设置为“仅SDK程序集”时,方法JsonConvert.DeserializeObjects起作用,但是当我在链接器属性中使用“链接SDK和用户程序集”选项构建项目时,该方法不起作用,它将在反序列化对象的所有字段中返回null。

xamarin xamarin.forms

2
推荐指数
1
解决办法
1595
查看次数