摘要: 第一步,下载工程 git clone https://github.com/maplibre/maplibre-react-native.git 第二步,运行工程 cd maplibre-react-native/example yarn install # 多次执行,直到没有错误提示 yarn r 阅读全文
posted @ 2024-05-28 17:02 李振欣 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 模块依赖 Entry依赖Feature 添加依赖信息: Entry模块的oh-package.json5文件的dependencies部分,添加对Feature模块的依赖: "@ohos/auth": "file:../auth", 或 "auth": "file:../auth", 添加多模块运行 阅读全文
posted @ 2023-12-07 16:35 李振欣 阅读(152) 评论(0) 推荐(0) 编辑
摘要: View相关 原文:SerfaceView与TextureView的区别 区别: Sureface有自己的Serface(由屏幕显示内容合成器(screen compositor)所管理的原生缓冲器的句柄)是一个单独的View,会在WMS中创建单独的窗口,有自己的渲染进程,不受UI层的控制,因此不能 阅读全文
posted @ 2023-04-02 09:23 李振欣 阅读(27) 评论(0) 推荐(0) 编辑
摘要: 一般使用state.animateScrollToPage()滑动的话会瞬间划过去。 如果想要加入滑动动画的话需要使用suspend fun ScrollableState.animateScrollBy(value: Float,animationSpec: AnimationSpec<Float 阅读全文
posted @ 2023-03-08 11:46 李振欣 阅读(399) 评论(0) 推荐(0) 编辑
摘要: 对于分类展示结构化数据的场景,一般使用Tab+Pager+List的形式。当tab的数量固定时比较好解决,最基础的方式是写n个PagingData和LazyListState: val recommendState = rememberLazyListState() val recommendDat 阅读全文
posted @ 2023-02-16 15:13 李振欣 阅读(563) 评论(0) 推荐(0) 编辑
摘要: 以下内容基于HarmonyOS 3.1 Developer Preview (API9)版本,虚拟机测试可以兼容API8 参考:鸿蒙开发者官网的文档 ArkTS采用装饰器标注对象的功能。 基础UI组件结构 每个UI组件需要定义为@Component struct对象,其内部必须包含一个且只能包含一个 阅读全文
posted @ 2023-01-10 23:03 李振欣 阅读(1892) 评论(0) 推荐(0) 编辑
摘要: 公司业务中需要用到阿里云的视觉智能图像搜索库,但是这个库只提供了java sdk,并没有android sdk。直接移植到android上,会出现bug: java.lang.NoSuchMethodError: No static method encodeBase64String([B)Ljav 阅读全文
posted @ 2022-06-16 10:10 李振欣 阅读(444) 评论(0) 推荐(0) 编辑
摘要: 来源:Does Jetpack Compose's LazyVerticalGrid have span strategy Jetpack Compose 版本 > 1.1.0-beta03 import androidx.compose.foundation.lazy.grid.GridItemS 阅读全文
posted @ 2022-06-14 17:22 李振欣 阅读(628) 评论(0) 推荐(0) 编辑
摘要: // viewmodel中定义两个数据 class LoginViewModel @Inject constructor() : BaseViewModel<LoginIntent>() { val height = MutableStateFlow(-1f) val weight = Mutabl 阅读全文
posted @ 2022-02-23 10:20 李振欣 阅读(1831) 评论(0) 推荐(0) 编辑
摘要: 做主页导航时会用到底部导航栏,Jetpack Compose提供了基础槽位的布局Scaffold,使用Scaffold可以构建底部导航栏,例如: @Composable fun Greeting(vm: VM) { val list = listOf("One", "Two", "Three") v 阅读全文
posted @ 2021-09-03 17:51 李振欣 阅读(1456) 评论(0) 推荐(0) 编辑