frame

Android: Adding a simple Fragment

ε祈祈猫儿з 提交于 2019-11-30 19:44:27
I am pretty new to Android Apps, so I hope I can find some help here. I have already searched for my problem in here and found something, but that does not work. I want to add a Fragment to a FrameLayout but it does not work. My goal ist to create a Frame (/Framework?) that is always present and the user can interact with it and inside this Frame in a specific "window" I want to display pages/fragments, five in total, and beeing able to switch the pages/fragments at any time, so I have an always present Frame and inside this dynamically changing pages. But for now I am stuck at the very

How to make the frame of a button custom shape in Swift 2

送分小仙女□ 提交于 2019-11-30 18:20:39
问题 I want the button to be reactive to tap only in the custom polygonal shape that I create and not in the CGRect frame. button.frame only supports CGRect. 回答1: Here is an example of a button that only responds to touches within a certain area. class MyButton: UIButton { var path: UIBezierPath! override func awakeFromNib() { backgroundColor = UIColor.greenColor() addTarget(self, action: #selector(touchDown), forControlEvents: .TouchDown) } override func drawRect(rect: CGRect) { path =

UIWebView and Animation

亡梦爱人 提交于 2019-11-30 15:20:03
I am wondering if there was a way to animate the size and position of a UIWebView. If I do sth like this: [UIView animateWithDuration:1.0 animations:^{ self.frame = CGRectMake(20.0, 20.0, 80.0, 80.0); }]; or [UIView beginAnimations:@"zoomIn" context:nil]; [UIView setAnimationDuration:2.75]; [UIView setAnimationDelegate: self]; self.frame = CGRectMake(20.0, 20.0, 80.0, 80.0); [UIView commitAnimations]; while there is a grey box doing the animation, the content of the WebView instantly switches to the new size without animating. (the scalesPageToFit property is set to YES) any suggestions on

Constant FPS Android OpenGLES

不打扰是莪最后的温柔 提交于 2019-11-30 10:51:23
Hello android developers, I am developing a simple game for Android in Eclipse using OpenGLES 1.0. I am using Samsung Galaxy S2 Android(2.3) as a device for development. And I have a question about dual core and making frame rate constant. So I have managed creating GLSurfaceView and override onDrawFrame() function where I call LogicUpdate(deltatime) function and Render() function. Yes, all in single thread for now. The problem I am getting is with dual core. If I disable dual core by going to Setting->Power saving and check System power saving I realize that rendering is automatically locked

Get frame from certain UISegmentedControl index?

£可爱£侵袭症+ 提交于 2019-11-30 10:24:52
In my app, I use a UIPopoverController and I use the presentPopoverFromRect API. What I am doing now is just setting it to the frame of my whole UISegmentedControl. However I want to be more precise than this. Is there any way to get the frame of a specific index in the UISegmentedControl? Thanks! If the segments are equal, why not just divide the width of the control by the number of the selected segment (+1 because numbering starts at 0)? EDIT: Like this -(void)showPopover:(id)sender { if ((UISegmentedControl*)sender.selectedSegmentIndex == 0) [self.popover presentPopoverFromRect:CGRectMake

Delphi TFrame Create/Destroy

空扰寡人 提交于 2019-11-30 10:04:18
How to create (when I want to show it) and destroy (when I want to hide it) frames on the main TForm? Frames' align = alClient. I tried this: The form: unit main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, uFrame1, uFrame2; type TFormMain = class(TForm) procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } f1: TFrame1; f2: TFrame2; end; var FormMain: TFormMain; implementation {$R *.dfm} procedure TFormMain.FormCreate(Sender: TObject); begin f1 := TFrame1.Create(Self); f1.Parent :=

Resizable frame emulation

£可爱£侵袭症+ 提交于 2019-11-30 08:12:10
I understand that <frameset> and <frame> tag are becoming deprecated. Is there a way to emulate resizable frames? What I want is a narrow separator separating the area either horizontally or vertically, which is movable by the user so that when one side of it becomes smaller, the other side becomes larger, and vice versa. I do not want to fill in each frame with an html page like the conventional frame, but instead with some DOM materials. I know that CSS3 has resize attribute, but that controls only the size of itself. I am not sure if this is to be used for the solution. I don't particularly

opencv Unable to stop the stream: Inappropriate ioctl for device

跟風遠走 提交于 2019-11-30 01:53:31
问题 I just want to convert video to frame images. Using this simple code import cv2 vidcap = cv2.VideoCapture('gog.mp4') success,image = vidcap.read() count = 0 success = True while success: success,image = vidcap.read() print 'Read a new frame: ', success cv2.imwrite("frame%d.jpg" % count, image) count += 1 output is Unable to stop the stream: Inappropriate ioctl for device I am using python 2.7.6 on ubuntu server. 回答1: I have solved this issue on Ubuntu 16.04.3. sudo apt-get install ffmpeg sudo

Python Tkinter clearing a frame

眉间皱痕 提交于 2019-11-30 01:35:33
I am trying to clear out a frame in the tkinter so that the new contents can be written (refresh information) but i could not manage to do it. I am aware of these frame.destroy() frame.pack_forget() frame.grid_forget() but frame.destroy() will totally remove the frame. And the other two also could not give me the result i want.What i need is just to clear up every items in the frame but the frame itself will stay . Is there anyway to do it? pack_forget and grid_forget will only remove widgets from view, it doesn't destroy them. If you don't plan on re-using the widgets, your only real choice

iPhone - Auto resizing UIWebView content do not fit the frame

*爱你&永不变心* 提交于 2019-11-29 22:16:21
I'm generating an UIWebView into my viewDidLoad method, with a tiny size (let's say something like 50x70). And then I put it into a super UIView. I'd like to make its content fit the webView frame. To do this, I wrote : oneView = [[UIWebView alloc] initWithFrame:CGRectMake(x, y, W, H)]; oneView.backgroundColor = [UIColor whiteColor]; oneView.autoresizingMask = UIViewAutoresizingFlexibleWidth; oneView.scalesPageToFit = YES; oneView.autoresizesSubviews = YES; [self.view addSubview:oneView]; [oneView loadRequest:/*some request*/]; But doing this, the web page is not resized to the frame of the