show

Android show softkeyboard with showSoftInput is not working?

╄→尐↘猪︶ㄣ 提交于 2019-12-03 06:42:17
问题 I have created a trivial application to test the following functionality. When my activity launches, it needs to be launched with the softkeyboard open. My code does not work?! I have tried various "state" settings in the manifest and different flags in the code to the InputMethodManager (imm). I have included the setting in the AndroidManifest.xml and explicitly invoked in the onCreate of the only activity. <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas

Determine if CSS property is set to a certain value?

风格不统一 提交于 2019-12-03 04:08:26
问题 Just wondering how to determine a jQuery statement like this if( $("#test").css('display', 'block') == true) { return true; } Basically, I want to be able to determine IF an element has is currently being shown or hidden via the "display:block" attribute ? 回答1: Use if( $("#test").css('display') == 'block') { I'm fairly sure .css() , returning a calculated value, will always return a lower case result - the docs say nothing on this. To make totally sure, you could do a if( $("#test").css(

Nicely printing/showing a binary tree in Haskell

扶醉桌前 提交于 2019-12-03 01:52:42
I have a tree data type: data Tree a b = Branch b (Tree a b) (Tree a b) | Leaf a ...and I need to make it an instance of Show , without using deriving . I have found that nicely displaying a little branch with two leaves is easy: instance (Show a, Show b) => Show (Tree a b) where show (Leaf x) = show x show (Branch val l r) = " " ++ show val ++ "\n" ++ show l ++ " " ++ show r But how can I extend a nice structure to a tree of arbitrary size? It seems like determining the spacing would require me to know just how many leaves will be at the very bottom (or maybe just how many leaves there are in

Checkbox shows hidden field - not working onload

大城市里の小女人 提交于 2019-12-02 22:14:53
问题 I am using this probably ugly javascript to show a text box (in a li tag plus its label) if a checkbox is checked. $("#li-2-21").css("display","none"); $("#Languages-spoken-and-understood-8").click(function(){ if ($("#Languages-spoken-and-understood-8").is(":checked")) { $("#li-2-21").show("fast"); } else { $("#li-2-21").hide("fast"); } }); That works fine but it doesn't work if a page is loaded and the checkbox is already checked because the #li-2-21 gets automatically hidden. Do I need to

jQuery: move window viewport to show freshly toggled element

前提是你 提交于 2019-12-02 20:52:38
I have a snippet of jQuery in doc ready which toggles a div containing a textarea : $('div#addnote-area').hide(); // hide the div $('a#addnote-link').click(function() { // click event listener on link $('div#addnote-area').toggle(); // toggle the hidden div }); The toggle works fine when clicking the link. The problem I'm having is that if div#addnote-area is below the browser's current viewport, it remains there when it's shown. I'd like the user's cursor to go to the textarea and for the whole textarea to be viewable in the window. Check out the scrollTo jQuery plugin . You can simply do

Toggle show\hide with jquery but with multiple ids

北城余情 提交于 2019-12-02 19:17:30
问题 I have a php page wich generates multiple ULs and a link above each UL, like this <a title="Category one" id="cat-1"> Category one </a> <ul id="subcategory-1-ul"> <li>Subcategory<li/> <li>Subcategory</li> <ul> <a title="Category two" id="cat-2"> Category two </a> <ul id="subcategory-2-ul"> <li>Subcategory<li/> <li>Subcategory</li> <ul> Because there are many subcategories into each main categories I want to hide the ULs and only show them when I click the anchor. I'm trying to use this jquery

Determine if CSS property is set to a certain value?

半城伤御伤魂 提交于 2019-12-02 17:27:44
Just wondering how to determine a jQuery statement like this if( $("#test").css('display', 'block') == true) { return true; } Basically, I want to be able to determine IF an element has is currently being shown or hidden via the "display:block" attribute ? Use if( $("#test").css('display') == 'block') { I'm fairly sure .css() , returning a calculated value, will always return a lower case result - the docs say nothing on this. To make totally sure, you could do a if( $("#test").css('display').toLowerCase() == 'block') { while you can rely on display giving reliable results, note that some CSS

How to show local notification every hour using service

旧时模样 提交于 2019-12-02 14:54:32
问题 I want to show local notification on every hour or particular seconds using service, I have tried to implement this functionality, but I didn't got success. My code is look like below AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent notificationIntent = new Intent("android.media.action.DISPLAY_NOTIFICATION"); notificationIntent.addCategory("android.intent.category.DEFAULT"); PendingIntent broadcast = PendingIntent.getBroadcast(this, 100,

Is it Possible to show a previously hidden JFrame using a keylistener

ぐ巨炮叔叔 提交于 2019-12-02 11:21:08
问题 here is my code, i basically just did a tester for the most common listeners, which i might later use in future projects, the main problem is in the keylistener at the bottom, i am trying to re-show the frame but i think it just cant be done that way, please help ps: no idea why the imports dont show up right. package newpackage; import java.awt.Color; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JSeparator

Toggle show\\hide with jquery but with multiple ids

梦想与她 提交于 2019-12-02 10:11:51
I have a php page wich generates multiple ULs and a link above each UL, like this <a title="Category one" id="cat-1"> Category one </a> <ul id="subcategory-1-ul"> <li>Subcategory<li/> <li>Subcategory</li> <ul> <a title="Category two" id="cat-2"> Category two </a> <ul id="subcategory-2-ul"> <li>Subcategory<li/> <li>Subcategory</li> <ul> Because there are many subcategories into each main categories I want to hide the ULs and only show them when I click the anchor. I'm trying to use this jquery: $(document).ready(function() { $('#toggle-link').click(function() { $('#ul-to-hideshow').toggle('slow