Created
January 6, 2019 05:08
-
-
Save masaibar/7a11e969fa3bc8b56c705cc88339fa8d to your computer and use it in GitHub Desktop.
ScrollViewを持ったAlertDialogを表示する ref: https://qiita.com/masaibar/items/33ac44545c0d37caee50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
AlertDialog.Builder(applicationContext) | |
.setTitle("title") | |
.setView(R.layout.view_scrollable_text) | |
.setPositiveButton( | |
"OK" | |
) { _, _ -> | |
// Do nothing | |
} | |
.show() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:padding="16dp"> | |
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:orientation="vertical"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="hoge" /> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:text="fuga" /> | |
</LinearLayout> | |
</ScrollView> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment