V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  qwwuyu  ›  全部回复第 1 页 / 共 7 页
回复总数  133
1  2  3  4  5  6  7  
@lixyz 还是 7L 方案靠谱,试了加 LastItem,效果很好,也不用写那么多额外代码了,奶茶还是让给 7L 吧~
试了一下,可以一直保持在底部,不会上下跳动,我这里没有去计算 TextView 改变后的高度,有需要可以自己监听控件高度变化,再去 scrollToPositionWithOffset.
代码图片 https://imgur.com/a/HU30yph
```
new Thread(() -> {
while (!isFinishing() && run) {
try {
Thread.sleep(200);
} catch (InterruptedException ignored) {
}
runOnUiThread(() -> {
if (textTv != null) {
textTv.setText(textTv.getText() + "asdasdasdasdasdasdasd");
int targetPosition = adapter.getItemCount() - 1;
View targetView = linearLayoutManager.findViewByPosition(targetPosition);
int offset = recyclerView.getHeight() - targetView.getHeight();
linearLayoutManager.scrollToPositionWithOffset(targetPosition, offset);
}
});
}
}).start();
```
const val compileSdkVersion = 34
const val minSdkVersion = 21
const val targetSdkVersion = 30
RelativeContainer() {
Column() {
Row() {
Text("Test1111")
.fontSize(14)
.fontWeight(FontWeight.Lighter)
.fontStyle(FontStyle.Italic)
.foregroundColor('#DDDDDD')
.flexGrow(1)
Button() {
Text("button")
.width(30)
.height(30)
}
.width(30)
.height(30)
.backgroundColor(Color.Transparent)
.foregroundColor('#DDDDDD')
}
.width('100%')
.alignItems(VerticalAlign.Top)

Text("long text long text long text long text long text long text long text long text long text long text")
.fontSize(14)
.fontWeight(FontWeight.Lighter)
.foregroundColor('#DDDDDD')
.width('100%')
.margin({ top: 2 })
}
.id('viewRight')
.backgroundColor(0xff0000)
.margin({ left: 10 })
.alignRules({
left: { anchor: '__container__', align: HorizontalAlign.Start },
right: { anchor: '__container__', align: HorizontalAlign.End },
})

Row()
.id('viewLine')
.width(3)
.backgroundColor(0x00ff00)
.alignRules({
top: { anchor: 'viewRight', align: VerticalAlign.Top },
bottom: { anchor: 'viewRight', align: VerticalAlign.Bottom },
})
}
.size({ width: '100%', height: 'auto' })
.margin({ top: 10 })
.backgroundColor(0x0000ff)

//RelativeContainer 可以做到,但是稍微用错容易出不明所以的 BUG
41 天前
回复了 magic3584 创建的主题 Android 如何入门 Android 开发
初学难点估计还是熟悉 API,刚开始可以避开依赖注入路由这些不必要的.
找简单的开源项目跑起来,读下流程,照着写,拷贝一些工具和组件到自己项目.
快速入手就找一个基础框架,直接删删改改去写代码.
很多问题 AI 大部分都可以解决,难点还是经验 UI 业务那些...
@dandycheung 最近审核确实很迷,其它平台都过了,vivo 先提示获取 ssid 频繁,再提示隐私政策不对,最后全修复了又告诉我 WebView 获取剪切板,不一次性测完...
@lw0x1 你那 WebView 加载隐私政策会调用 webSetting.setJavaScriptEnabled(true)吗?
@paopjian 这块内容多,有很多链接,本地链接到服务器的服务条款和隐私政策,隐私政策会依赖第三方 SDK,会提供 h5 链接,最后依旧避免不了使用 WebView.
@MozzieW 第一条正在尝试,但是虽然是系统行为,估计也要 APP 买单,之前查出 WebView 获取定位信息,那个是可以 API 关闭的.
第二条没办法,因为用的 WebView 加载的隐私政策,没同意之前就触发了系统剪切板行为
42 天前
回复了 zong400 创建的主题 Android 从黄 xx 送车看到安卓和 iPhone 的区别
@Y25tIGxpdmlk 我那会是网络速度问题,大家聚在房间里一起,ios 信号差了点,然后我开热点给同事 ios 一起抢,稍微好了一点
42 天前
回复了 zong400 创建的主题 Android 从黄 xx 送车看到安卓和 iPhone 的区别
去年年会,领导群里发微信红包,安卓优先抢到,ios 红包出来的慢...
直接运行 debug 包 用 jadx 反编译 然后搜索文本 PACKAGE_ADDED
1  2  3  4  5  6  7  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5543 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 21ms · UTC 03:08 · PVG 11:08 · LAX 19:08 · JFK 22:08
Developed with CodeLauncher
♥ Do have faith in what you're doing.