TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask: iOS question - border that rotates with view but doesn't scale with it?

1 点作者 DrorY将近 13 年前
I am a long time web developer. Started developing for ios. I've created a view. The user can rotate, scale and move it. My question is, how do I attach a border to it in such a way that the border will rotate with the view, but won't scale with it?<p>Thanks.

2 条评论

objclxt将近 13 年前
Consider using StackOverflow for questions like this...there's a substantial number of iOS devs who hang around there (myself included!) - plus it's far more likely somebody else with the same problem will stumble upon your question and spread the knowledge.<p>With regards to your specific question, if you use the various border properties of the underlying `CALayer` (`borderColor`, `borderWidth`, etc) and scale the view by changing its bounds the border will retain the same width as before. You can also scale a view by transforming it, but that's slightly different.
评论 #4034427 未加载
jacksondeane将近 13 年前
I'd probably use 2 different views, one for the view you are manipulating and 1 for the border. You can apply the same rotation transforms to both views but only apply the scale transforms to the main view.