小编use*_*270的帖子

iOS7所有这些颜色有什么区别,"barTintColor,tintColor,backgroundColor,UITextAttributeTextColor"?

我对iOS7中的navigationController中的所有这些颜色设置感到困惑.有人能告诉我这些东西之间究竟有什么区别吗?我试图找出其中一些,但不确定我是否正确.

谢谢!

self.navigationController.navigationBar.barTintColor=[UIColor redColor];//???

self.navigationController.navigationBar.backgroundColor=[UIColor greenColor];//???

self.navigationController.navigationBar.tintColor=[UIColor whiteColor];//the text colour of backButton of the navigationBar???

self.navigationController.navigationBar.titleTextAttributes = @{UITextAttributeTextColor:[UIColor blueColor]};//the text color of the title of the navigationBar

 [self.navigationItem.rightBarButtonItem setTitleTextAttributes:@{UITextAttributeTextColor:[UIColor greyColor]} forState:UIControlStateNormal];//the text colour of the customised rightButton in the navigationBar
Run Code Online (Sandbox Code Playgroud)

tintcolor ios7

8
推荐指数
1
解决办法
7071
查看次数

Android Jetpack Compose:如何在“框”中缩放图像?

我将在一个框中构建一个可缩放的图像视图,就像第一个屏幕截图一样。但是当我放大图像时,它会开箱即用。有没有办法缩放图像,但保持大小?没有viewfragmentbox似乎还不够。我期待图像变大,但仍然留在红框内,但放大后我得到了第二个屏幕截图。

放大前 放大后

多亏了 nglauber 和 Amirhosein,我得到了在“框”(固定区域)内同时具有缩放和拖动功能的最终解决方案,并将以下代码作为新的屏幕截图,如下所示。

        val imageBitmap = imageResource(id = R.drawable.android)
        Image(
            modifier = Modifier
                .preferredSize(400.dp, 300.dp)
                .clip(RectangleShape)
                .zoomable(onZoomDelta = { scale.value *= it })
                .rawDragGestureFilter(
                    object : DragObserver {
                        override fun onDrag(dragDistance: Offset): Offset {
                            translate.value = translate.value.plus(dragDistance)
                            return super.onDrag(dragDistance)
                        }
                    })
                .graphicsLayer(
                    scaleX = scale.value,
                    scaleY = scale.value,
                    translationX = translate.value.x,
                    translationY = translate.value.y
                ),
            contentDescription = null,
            bitmap = imageBitmap
        )
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

android android-jetpack-compose

2
推荐指数
3
解决办法
1063
查看次数