【Java】permutation

改善の余地しかないですが、以下で実装できます。srcは{1,2,3}のような順列を取得してほしい値の配列で、返り値がそのすべての順列結果を含んだ配列です。 ちなみに、自分の環境だとsrcの配列数が11になった時点でOut … 続きを読む

【Java】配列操作

Javaで配列を使用するのは、よっぽど性能が求められる場面に限られており、むしろ型安全が保障されない場合があるので基本的にListを使用した方がいいです。そもそも配列の標準ライブラリが貧弱で、Listでは簡単に実現できる … 続きを読む

カテゴリー Java

【Java】Genericsまとめ

何度か書籍で読んで、何度か作成したこともあって分かった気になっていたが、全然細かいところまで理解できていなかったので、自分でまとめてみる 総論 単語 単語 説明 例 Generic Type Genericな型 List … 続きを読む

カテゴリー Java

java.lang.IllegalStateException: Vertically scrollable component was measured with an infinity maximum height constraints, which is disallowed. One of the common reasons is nesting layouts like LazyColumn and Column(Modifier.verticalScroll()). If you want to add a header before the list of items please add a header as a separate item() before the main items() inside the LazyColumn scope. There are could be other reasons for this to happen: your ComposeView was added into a LinearLayout with some weight, you applied Modifier.wrapContentSize(unbounded = true) or wrote a custom layout. Please try to remove the source of infinite constraints in the hierarchy above the scrolling container.

タイトルのエラーはLazyColumnやColumn(Modifier.verticalScroll())等がネストしている時に発生します。 2つネストすると確かにスクロール入力がどちらになるか分からないし、高さが決めら … 続きを読む