visio 如何按指定比例调整形状大小,指定比例进行放大缩小
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了visio 如何按指定比例调整形状大小,指定比例进行放大缩小相关的知识,希望对你有一定的参考价值。
visio中图形,想按指定比例调整大小
比如将一个图形调整到原来的80%
将另个图形调整到原来的75%
也就是说想分别按自己指定的比例调整图形大小,不是拉调整点进行视觉调整,想按指定的比例精确调整,进行放大缩小
实现的方法和详细的操作步骤如下:
1、第一步,启动Visio
2016绘图软件,打开新的地图和平面图选项,单击平面图图标以创建新的平面图,如下图所示,然后进入下一步。
2、其次,完成上述步骤后,插入任意的图形,右键单击鼠标,然后单击下侧的“页-1”标签,如下图所示,然后进入下一步。
3、接着,完成上述步骤后,在页面设置中选择页面的图形缩放比例,选择预定义的缩放比例单选框,然后选择所需的比例,如下图所示,然后进入下一步。
4、最后,完成上述步骤后,单击右侧的应用程序,以查看更改图形缩放比例的效果。
单击确定以完成设置,如下图所示。这样,问题就解决了。
注:以上在visio2013中亲测有效。 参考技术B 将图形选中,进行组合,再打开视图-任务窗格-大小和位置,长宽都乘对应的比例即可,我用的Visio2010,亲测有效 参考技术C 按住shift从角拖动,可以等比例缩放。 参考技术D 怎么没有人回答啊,多好的问题,求解????
如何调整视图的大小,同时按比例调整其子视图的大小?
【中文标题】如何调整视图的大小,同时按比例调整其子视图的大小?【英文标题】:How can I resize a view, while proportionally resizing it's subviews? 【发布时间】:2015-12-13 06:54:30 【问题描述】:我正在尝试创建一个自定义 segue,其中第一个视图控制器缩小一点,第二个在它上面滑动。以下是我的 segue 实现:
override func perform()
let firstView = self.sourceViewController.view as UIView!
let secondView = self.destinationViewController.view as UIView!
let screenSize = UIScreen.mainScreen().bounds.size
let window = UIApplication.sharedApplication().keyWindow
secondView.frame = CGRectMake(0.0, screenSize.height, screenSize.width, screenSize.height)
window?.insertSubview(secondView, aboveSubview: firstView)
UIView.animateWithDuration(2, delay: 0, options: .CurveEaseIn, animations:
// BEGIN RELEVANT PORTION
let offset: CGFloat = 20
firstView.frame = CGRectMake(offset, offset, screenSize.width - (offset * 2), screenSize.height - (offset * 2))
firstView.autoresizesSubviews = true
firstView.layoutIfNeeded()
// END RELEVANT PORTION
, completion: nil)
UIView.animateWithDuration(5, delay: 1, options: .CurveEaseOut, animations:
secondView.frame = CGRectMake(0.0, 0.0, screenSize.width, screenSize.height)
, completion: nil)
这会产生如下结果:
这已经很棒了,但不是我想要的。我需要子视图(“嗨,我是 Matt。”标签和按钮)与父视图成比例地调整大小,就好像整个视图都在 z 轴上下降一样。
我正在使用自动布局。
非常感谢您!
【问题讨论】:
你想让标签和按钮相对于它的 superView 缩小吗? @MuhammadWaqasBhati 是的,这就是我想要做的。 :) 您是否在标签和按钮上添加了约束及其超级视图? 是的。它们都在超级视图约束中具有中心,标签的水平中心有一个常数 我已经在下面添加了答案,告诉我它是否不起作用 【参考方案1】:我使用CGAffineTransform
解决了这个问题。
override func perform()
let firstView = self.sourceViewController.view as UIView!
let secondView = self.destinationViewController.view as UIView!
let screenSize = UIScreen.mainScreen().bounds.size
let window = UIApplication.sharedApplication().keyWindow
secondView.frame = CGRectMake(0.0, screenSize.height, screenSize.width, screenSize.height)
window?.insertSubview(secondView, aboveSubview: firstView)
firstView.layer.anchorPoint = CGPoint(x: 0.0, y: 0.0)
firstView.layer.position = CGPoint(x: 0.0, y: 0.0)
UIView.animateWithDuration(0.2, delay: 0, options: .CurveEaseInOut, animations:
print(firstView.frame)
let offset: CGFloat = 25
let offsetX = 2 * (offset / firstView.frame.width)
let offsetY = 2 * (offset * (firstView.frame.height / firstView.frame.width) / firstView.frame.height)
let transform = CGAffineTransformScale(CGAffineTransformIdentity, 1 - offsetX, 1 - offsetY)
firstView.transform = transform
firstView.layer.position = CGPoint(x: offset, y: offset)
, completion: nil)
UIView.animateWithDuration(0.5, delay: 0.05, options: .CurveEaseOut, animations:
secondView.frame = CGRectMake(0.0, 0.0, screenSize.width, screenSize.height)
) finished -> Void in
self.sourceViewController.presentViewController(self.destinationViewController, animated: false, completion: nil)
谢谢大家的帮助!
【讨论】:
【参考方案2】:应用变换是实现它的好方法。
还有另一种方法可以实现它,而不会修改第一个视图控制器的视图框架。拍摄第一个 viewcontroller 视图的快照并使用它而不是视图本身。您可以在 UIView 中使用以下方法来拍摄快照:
- (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates;
【讨论】:
【参考方案3】:我在 Xcode 中使用您的场景进行了尝试,现在您必须按照以下步骤操作
1- Give UIButton & UILabel Leading and Trailing Space to their SuperView
2- Make UIButton central Vertically
3- Give Vertical Space from UIButton to UILabel
重要:
希望它会起作用,因为技巧是您必须为超级视图提供前导和尾随空间,以使 InnerViews 收缩或扩展其超级视图
【讨论】:
【参考方案4】:一种方法可以是:
给它们(标签和按钮)宽度限制。 制作两个宽度限制的出口。 constraintWidthLabel、constraintWidthButton 您可以像这样解除约束当您执行 segue 时,您必须通过动画将这些宽度约束设为零。
UIView.animateWithDuration(2, delay: 0, options: .CurveEaseIn, animations:
// BEGIN RELEVANT PORTION
let offset: CGFloat = 20
constraintWidthLabel.constant = 0
constraintWidthButton.constant = 0;
firstView.frame = CGRectMake(offset, offset, screenSize.width - (offset * 2), screenSize.height - (offset * 2))
firstView.autoresizesSubviews = true
firstView.layoutIfNeeded()
// END RELEVANT PORTION
, completion: nil)
【讨论】:
以上是关于visio 如何按指定比例调整形状大小,指定比例进行放大缩小的主要内容,如果未能解决你的问题,请参考以下文章