无法将 MKMapView 从中心位置移动?

发布于 2024-09-10 06:57:24 字数 328 浏览 0 评论 0原文

我正在创建一个简单的 iPhone 应用程序来显示地图和一些标签,但是当我将 MKMapView 放入界面生成器中时,它喜欢居中。

我对此很陌生,所以我为我的无知道歉。

我似乎找不到将 MKMapView 从其中心位置移动的方法。我可以缩放边缘,但是缩放会在两侧镜像,并且不允许我手动更改 x 和 y 值。我想将 MKMapView 移动到屏幕顶部并在底部有一些标签,但是我不希望顶部有任何额外的空间。

是否有任何我可以使用的方法(在 Interface Builder 中或在实际的 Objective C 代码中)可以让我更自由地移动 MKMapView?

谢谢你, -哔叽

I am working with creating a simple iPhone app to show a map and some labels, however the MKMapView likes being centered when I put it in the interface builder.

I am very new to this, so i apologize for my ignorance.

I cannot seem to find a way to move the MKMapView from its centered position. I can scale the edges, however the scaling is mirrored on both sides and it does not let me alter the x and y value manually. I want to move the MKMapView to the top of the screen and have some labels on the bottom, however I don't want any extra space at the top.

Is there any method I can use (either within the Interface Builder OR in the actual Objective C code) which will let me move the MKMapView more freely?

Thank you,
-Serge

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如此安好 2024-09-17 06:57:24

听起来您正试图将其放置在光秃秃的窗户中。如果您想将其放置在屏幕的某个位置,您需要首先在窗口中放置一个常规视图(可以填充整个窗口),然后将 MKMapView 放在该视图上。您可以将其移动到您想要的任何位置。

It sounds like you're attempting to place it in a bare window. If you want to position it on a portion of the screen somewhere you'll want to place a regular View in the window first (that could just fill the window), then put the MKMapView on that view. You'll be able to move it to wherever you'd like.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文