scale

setPivotX works strange on scaled View

故事扮演 提交于 2020-01-22 11:02:06
问题 I found out that setPivotX (also setPivotY ) works strange in Android. If you set pivot when view's scale is set to 1.00f nothing happens (just pivot changes). But if the scale isn't equal 1.0f (e.g. setScaleX(0.9f) ) and you set the pivot the view moves relatively(?) to the new pivot. Isn't it strange? I know that horizontal and vertical positions (translations) are NOT related to the pivot value, but why the view moves with scale factor other than 1.0f? Please check this out with and

setPivotX works strange on scaled View

≯℡__Kan透↙ 提交于 2020-01-22 11:02:04
问题 I found out that setPivotX (also setPivotY ) works strange in Android. If you set pivot when view's scale is set to 1.00f nothing happens (just pivot changes). But if the scale isn't equal 1.0f (e.g. setScaleX(0.9f) ) and you set the pivot the view moves relatively(?) to the new pivot. Isn't it strange? I know that horizontal and vertical positions (translations) are NOT related to the pivot value, but why the view moves with scale factor other than 1.0f? Please check this out with and

Zoom to and from point

末鹿安然 提交于 2020-01-22 02:24:12
问题 I'm trying to zoom a DisplayObject into a certain point. I figured it would be easy, but I've spent a day now trying to figure it out. Basically, I think this should work. Emphasis on should. //newPoint is the point being centered. There is no initial scaling, so I do not need to compensate for that (yet) //scale is the zoom level //container is the parent of the obj //obj is the object being scaled/panned var p:Point = new Point( ( this.container.width - this.obj.width * scale + newPoint.x *

How to scale small imageview to fill large scrollview?

走远了吗. 提交于 2020-01-17 04:04:05
问题 How do you create a layout with a screen-filling scrollview that has a small image in an imageview scaled to fit the whole scrollview and be scrollable? eg. A 720x1280 display has a full-screen scrollview (fill_parent). Inside is a linearlayout (fill_parent). In that is a 300x900 bitmap in an imageview that is upscaled to 720x2160, fills the screen width and exceeds the vertical bounds, and can be scrolled up/down in the scrollview. The solution should work for all screen sizes to support

How to scale small imageview to fill large scrollview?

て烟熏妆下的殇ゞ 提交于 2020-01-17 04:04:00
问题 How do you create a layout with a screen-filling scrollview that has a small image in an imageview scaled to fit the whole scrollview and be scrollable? eg. A 720x1280 display has a full-screen scrollview (fill_parent). Inside is a linearlayout (fill_parent). In that is a 300x900 bitmap in an imageview that is upscaled to 720x2160, fills the screen width and exceeds the vertical bounds, and can be scrolled up/down in the scrollview. The solution should work for all screen sizes to support

Scale Animation Causes View to shorten before start of animation

不打扰是莪最后的温柔 提交于 2020-01-16 05:19:08
问题 So I have this scaling animation and what it's supposed to do is scale the view to 70% of the full height, and then scale it back to the original size. I have two scale animations with different startOffsets. The problem I'm having with this is the view scales before the animations even start. So when the animations start, they work with the already-shortened-scaled view. Here is my animation xml: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res

Using bounce animation on a scaled element

爱⌒轻易说出口 提交于 2020-01-15 03:48:41
问题 What is the best way to have something scale and then perform a bounce animation at that scale factor before going back to the original scale factor. I realize I could do something like scaling it to 2.2, then 1.8, then 2.0, but I'm looking for a way where you just have to perform the bounce animation on the scale factor because my scale factor will change. Here is my example. Basically I want to combine the two to work like I said but as you can see the bounce animation performs based off

Scale website to mobile devices

天涯浪子 提交于 2020-01-13 08:17:48
问题 I have a web app where responsive layout is not an option for mobile devices, so I tried playing with the viewport scaling a bit but had no success in doing so. Page size is 1280x720 so on small screens it should be zoom out and on larger ones zoomed in: var scale = $(window).width() / 1280; $('head').append('<meta name="viewport" content="width=device-width, height=device-height, initial-scale=' + scale + ', maximum-scale=' + scale + ', user-scalable=0">'); I've only tried this for width but

Database Backed Work Queue

痴心易碎 提交于 2020-01-13 06:34:10
问题 My situation ... I have a set of workers that are scheduled to run periodically, each at different intervals, and would like to find a good implementation to manage their execution. Example: Let's say I have a worker that goes to the store and buys me milk once a week. I would like to store this job and it's configuration in a mysql table. But, it seems like a really bad idea to poll the table (every second?) and see which jobs are ready to be put into the execution pipeline. All of my

Reduce the size of the iPhone Simulator window? [duplicate]

主宰稳场 提交于 2020-01-11 18:54:13
问题 This question already has answers here : How to resize the iPhone/iPad Simulator? (11 answers) Closed 2 years ago . Is it possible to resize the iPhone Simulator? I'm using screen capture software to record a demo of my iPhone application, and it would be handy to be able to resize the iPhone Simulator window. Thanks! 回答1: You should try cmd 2 or cmd 3 on your keyboard to scale down. And cmd 1 to get back to the original scale. 回答2: Unfortunately no, it must maintain that size. We had the