带有按钮图像的 Xcode 6 约束

2023-09-09移动开发问题
0

本文介绍了带有按钮图像的 Xcode 6 约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在创建一个应用程序,它有一个包含 11 个图像的仪表板..

I am creating an app that have a dashboard with 11 images..

1 是背景,1 是分隔按钮的线条,9 是带有图像的按钮.

1 is the background, 1 are the lines that divide the button and 9 are the button with images.

我尝试了几次自动约束分配,但我也手动尝试过,但我无法弄清楚如何正确设置约束.我也跟着很多教程.如果你看下面的图片,你会发现特别是 iPhone 4 中的按钮/图片很奇怪!

I tried several times with the automatic constraints assignment but I also tried manually and I can't figure it out how to setup the constraints correctly. I followed also a lot of tutorial. If you watch the image below, you can see that the button/images especially in the iPhone 4 are weird!

推荐答案

你必须采取一个包含按钮的视图....之后只需按照下图设置视图约束...您有 9 个图像...我刚刚给你演示了 7 个按钮

you have to take a view which contains a button....after that just follow the below image for set up view constraints...You have 9 images ...I just gave you demo with 7 buttons

对于按钮,只有 4 个约束...我设置了一个...您只需要遵循所有按钮...

and for button there is just 4 constraints...I setup for one...you just need to follow for all buttons...

这是结果图像...

这篇关于带有按钮图像的 Xcode 6 约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

恢复游戏 cocos2d
Resume game cocos2d(恢复游戏 cocos2d)...
2024-08-12 移动开发问题
6

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

[ios.cocos2d+box2d]如何禁用自动旋转?
[ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)...
2024-08-12 移动开发问题
7

从 Documents 目录存储和读取文件 iOS 5
Storing and reading files from Documents directory iOS 5(从 Documents 目录存储和读取文件 iOS 5)...
2024-08-12 移动开发问题
9

如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?
How can I implement a virtual joystick for a cocos2d game outside the cocos2d environment?(如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?)...
2024-08-12 移动开发问题
13