diff --git a/app/src/main/java/io/legado/app/ui/book/read/ContentEditDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/ContentEditDialog.kt index 623022b34..c1a2d013a 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ContentEditDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ContentEditDialog.kt @@ -54,6 +54,13 @@ class ContentEditDialog : BaseDialogFragment(R.layout.dialog_content_edit) { } viewModel.initContent { binding.contentView.setText(it) + binding.contentView.post { + binding.contentView.apply { + val lineIndex = layout.getLineForOffset(ReadBook.durChapterPos) + val lineHeight = layout.getLineTop(lineIndex) + scrollTo(0, lineHeight) + } + } } }