Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CapturedView is not supporting horizontal scroll #2

Open
SaMumcu opened this issue May 19, 2022 · 4 comments
Open

CapturedView is not supporting horizontal scroll #2

SaMumcu opened this issue May 19, 2022 · 4 comments

Comments

@SaMumcu
Copy link

SaMumcu commented May 19, 2022

After adding 13 items, I am not able to scroll items in the CapturedView.

For solution:

In CapturedView composable function we can add Row modifier horizontalScroll with scrollState parameter and fillMaxWidth()

I can open PR if you allow me to do this.

val scrollState = rememberScrollState()
    Row(
        modifier = Modifier
            .background(MaterialTheme.colors.surface)
            .height(CAPTURED_PIECE_SIZE)
            .fillMaxWidth()
            .horizontalScroll(scrollState)
            .then(modifier)
    ) {
        pieces.forEach {
            PieceView(piece = it, modifier = Modifier.width(CAPTURED_PIECE_SIZE).height(CAPTURED_PIECE_SIZE))
        }
    }

Thanks

@Zego001
Copy link

Zego001 commented Jan 25, 2024

After adding 13 items, I am not able to scroll items in the CapturedView.

For solution:

In CapturedView composable function we can add Row modifier horizontalScroll with scrollState parameter and fillMaxWidth()

I can open PR if you allow me to do this.

val scrollState = rememberScrollState()
    Row(
        modifier = Modifier
            .background(MaterialTheme.colors.surface)
            .height(CAPTURED_PIECE_SIZE)
            .fillMaxWidth()
            .horizontalScroll(scrollState)
            .then(modifier)
    ) {
        pieces.forEach {
            PieceView(piece = it, modifier = Modifier.width(CAPTURED_PIECE_SIZE).height(CAPTURED_PIECE_SIZE))
        }
    }

Thanks

@Zego001
Copy link

Zego001 commented Jan 25, 2024

@Zego001

@Zego001
Copy link

Zego001 commented Mar 16, 2024

@Zego001

@Spring167
Copy link

要是哪个很牛逼的人写出一个中国象棋的程序出来,有单机游戏的那种人工智能,不谋利,把代码共享到github,那时一件多美妙的事

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants