frame

Weird behavior of UIView frame after rotation in iPhone

寵の児 提交于 2019-12-18 02:16:06
问题 Create a square UIView object testView_, and add this at viewDidLoad: - (void)viewDidLoad { [super viewDidLoad]; CGRect initialRect = testView_.frame; NSLog(@"before rotation: w %f h %f x %f y %f", initialRect.size.width, initialRect.size.height, initialRect.origin.x, initialRect.origin.y); testView_.transform = CGAffineTransformMakeRotation(0.1); NSLog(@"after rotation: w %f, h %f, x %f, y %f", testView_.frame.size.width, testView_.frame.size.height, testView_.frame.origin.x, testView_.frame

How to reset AnimationDrawable

 ̄綄美尐妖づ 提交于 2019-12-17 23:15:30
问题 I have to animate a circular count down timer and I'm doing it by animating the background of an ImageView using AnimationDrawable (each image has the according slice of the circle removed). The problem is that the user has the ability to pause this animation, so I have to reload the animation but then a problem appears. I've tried setting the the animation to null, setting the background of the ImageView to null, setting the visibility of the animation, but practically nothing helped,

How to prevent parent frame closed when closing child frame (Java + iReport)?

落爺英雄遲暮 提交于 2019-12-17 19:36:57
问题 Basically I want to call JasperViewer from a button on my Main Application. I use this private void btnExportActionPerformed(java.awt.event.ActionEvent evt) { try { JasperPrint printer = JasperFillManager.fillReport(getClass().getResourceAsStream("reportRecharge.jasper"), params, new JREmptyDataSource()); JasperViewer jv = new JasperViewer(printer); jv.setVisible(true); } catch (JRException ex) { ex.printStackTrace(); } } When a JasperViewer appear and I close it, the main frame / parent also

Difference between contentDocument and contentWindow javascript iframe/frame access properties

人走茶凉 提交于 2019-12-17 18:13:30
问题 What is the difference between these two properties (contentDocument and contentWindow)? Is there any difference in the way they acces the content in the frame/iframe? Is there any performance issues? Should I use contentXXXXX.document.getElementsBy... or contentXXXXX.getElementsBy... ? I've been searching around in the web but haven't found too much information and before I did a big research I thought I could ask the great community here at stackoverflow. As a comment I'm doing a script

UIScreen MainScreen Bounds returning wrong size

安稳与你 提交于 2019-12-17 07:20:09
问题 So I created a new project with the latest version of XCode and tried to log the screen size of my app (to determine the device type for UI). I ran the following code from my iPhone 5: NSLog(@"%f", [[UIScreen mainScreen] bounds].size.height); This returned 480 , which is the screen size for the old iPhone family. I tried in the simulator and the same thing happened. Is there some property I have to enable in the project for it to recognize the screen size? This only happens for 5+ devices; if

How to locate and click on an element which is nested within multiple frame and frameset through Selenium using Webdriver and C#

佐手、 提交于 2019-12-17 06:56:11
问题 I have html page like below and I need to click on Login inside the class clslogin. How do I traverse to find the Login. I'm using C# with selenium Webdriver. With XPath (/html/body/div/table/tbody/tr[1]/td[3]/a) I'm not getting control on Login class, always element not found error is throwing. Can anybody help me to get exact xpath. <html> <head></head> <frameset name="mytestTopFrame" rows="*"...... > <frame name="mytestTopsubframe" src="index.html" width="100%"......... > <html> <head><

Converting preview frame to bitmap

时光毁灭记忆、已成空白 提交于 2019-12-17 06:46:08
问题 I know the subject was on the board many times, but i can not get it work anyhow... I want to save view frames from preview to jpeg files. It looks more or less(code is simplified- without additional logic, exception etc) like this... public void onPreviewFrame(byte[] data, Camera camera) { int width = camera.getParameters().getPreviewSize().width; int height = camera.getParameters().getPreviewSize().height; final int[] rgb = decodeYUV420SP(data, width, height); Bitmap bmp = Bitmap

Calling functions from a Tkinter Frame to another

这一生的挚爱 提交于 2019-12-17 05:13:37
问题 I have a page where I'll show some customers details. So I created a page called "customers details" with all the labels that I need and I set the text of these labels as variables. Too bad it doesn't work. The labels are created in the __init__ method so I can't "update" them, becouse the init is called only at the beginning. So what I thought is to create a new function that contains all the labels and I will call that function when I have the necessity...here's the problem. I'm not able to

tkinter gui layout using frames and grid

我的梦境 提交于 2019-12-17 04:30:09
问题 My gui layout looks almost nothing like what I expect so I assume there are some basics that I don't understand. I assumed that frames contain their own 'grid space' (row, column) but the behavior I see doesn't bear that out, and I'm at a loss for getting things working the way I want for the top frame. My labels are supposed to be on the same row L to R, under a 'frame label' that spans the entire frame - except they don't. I want the actual to look more like the goal jpg, and I want to use

Adjust UILabel height to text

核能气质少年 提交于 2019-12-17 02:33:43
问题 I have some labels which I want to adjust their height to the text, this is the code I wrote for this now func heightForView(text:String, font:UIFont, width:CGFloat) -> CGFloat{ let label:UILabel = UILabel(frame: CGRectMake(0, 0, width, CGFloat.max)) label.numberOfLines = 0 label.lineBreakMode = NSLineBreakMode.ByWordWrapping label.font = font label.text = text label.sizeToFit() return label.frame.height } EDIT: The issue was not in this piece of code, so my fix is in the question itself. It