Search Results

Search found 2 results on 1 pages for 'xkr'.

Page 1/1 | 1 

  • Manually changing keyboard orientation for a view that's on top of a camera view

    - by XKR
    I'm basically trying to reproduce the core functionality of the "At Once" app. I have a camera view and another view with a text view on it. I add both views to the window. All is well so far. [window addSubview:imagePicker.view]; [window addSubview:textViewController.view]; I understand that the UIImagePickerController does not support autorotation, so I handle it manually by watching UIDeviceOrientationDidChangeNotifications and applying the necessary transforms to the textViewController.view. Now, the problem here is the keyboard. If I do nothing, it just stays in portrait mode. I can get it to rotate by adding the following code to the notification handler. [[UIApplication sharedApplication] setStatusBarOrientation:interfaceOrientation]; [textView resignFirstResponder]; [textView becomeFirstResponder]; However, the following simple test produces weird behavior. Start the app in portrait mode. Rotate the device 90 degrees clockwise. Rotate the device 90 degrees counterclockwise (back to the initial position). Rotate the device 90 degrees clockwise. After step 4, instead of the landscape-mode keyboard, the portrait-style keyboard is shown, skewed to fit in the landscape keyboard frame. Perhaps my approach is wrong from the start. I was wondering if anyone has been able to reliably make the keyboard change its orientation in response to setStatusBarOrientation.

    Read the article

  • Activesupport::JSON.decode crashes on this,

    - by Waheedi
    I wonder why i cant decode this json string, all what i want is to convert this to a proper Ruby hash, anyone have an idea? i think the array of objects is cracking it ? Parameters: {"{\"origins\":"=>{"{\"origin\":\"this\"},{\"origin\":\"dont\"},{\"origin\":\"dont me please\"},{\"origin\":\"and me please\"},{\"origin\":\"dont\"},{\"origin\":\"dont\"},{\"origin\":\"dont\"},{\"origin\":\"okay\"},{\"origin\":\"dont\"},{\"origin\":\"go\"},{\"origin\":\"go\"}"=>{",\"url\":\"file:///Users/waheed/Desktop/untitled.html\",\"apik\":\"helloapik\",\"host\":\"http://localhost:3000/\"}"=>nil}}} now in my javascript im doing this //this is the object im trying to send over xmlhttprequest and im using JSON.org library which has the stringify method function tObject(origins,url,apik){ this.origins=origins; //this is an array of string this.url=url; this.apik=apik; } var t = new tObject(myStringArr,"www.foo.com","welcome guys"); ajax = new Ajax(); //this is an xhcon class you dont worry about it url here http://xkr.us/code/javascript/XHConn/ ajax.connect("http://localhost:3000/","POST",JSON.stringify(t), callback); in my rails app the parameters that has been posted looks like this: Parameters: {"{\"origins\":"={"{\"origin\":\"this\"},{\"origin\":\"yo yo\"},{\"origin\":\" me please\"},{\"origin\":\"and me please\"},{\"origin\":\"here\"},{\"origin\":\"and again\"},{\"origin\":\"again\"},{\"origin\":\"okay\"},{\"origin\":\"yes\"},{\"origin\":\"go\"},{\"origin\":\"go\"}"={",\"url\":\"www.foo.com\",\"apik\":\"welcome guys\"}"=nil}}} why it results with nil at the last ? i've tried to decode it but it could not work because it blame the string is not json string ?!!? TIA, waheedi

    Read the article

1