What is the height of iPhone’s onscreen keyboard?

I used the following approach for determining the frame of the keyboard in iOS 7.1. In the init method of my view controller, I registered for the UIKeyboardDidShowNotification: NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; [center addObserver:self selector:@selector(keyboardOnScreen:) name:UIKeyboardDidShowNotification object:nil]; Then, I used the following code in keyboardOnScreen: to gain access to the frame of the keyboard. … Read more

jquery get height of iframe content when loaded

ok I finally found a good solution: $(‘iframe’).load(function() { this.style.height = this.contentWindow.document.body.offsetHeight + ‘px’; }); Because some browsers (older Safari and Opera) report onload completed before CSS renders you need to set a micro Timeout and blank out and reassign the iframe’s src. $(‘iframe’).load(function() { setTimeout(iResize, 50); // Safari and Opera need a kick-start. var … Read more

Make text height 100% of div?

To get the result I wanted, I had to use this code: // Cache the div so that the browser doesn’t have to find it every time the window is resized. var $div = $(‘li.leaf.item’); // Run the following when the window is resized, and also trigger it once to begin with. $(window).resize(function () { … Read more

Android: How to measure total height of ListView [duplicate]

Finally I’ve done it! This is the working code which measures ListView height and sets ListView in full size: public static void getTotalHeightofListView(ListView listView) { ListAdapter mAdapter = listView.getAdapter(); int totalHeight = 0; for (int i = 0; i < mAdapter.getCount(); i++) { View mView = mAdapter.getView(i, null, listView); mView.measure( MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); totalHeight … Read more