selected

How do I style selected item in Android ListView?

假如想象 提交于 2019-11-27 04:37:50
问题 I am an Android newbie trying to learn the UI side of things and it's doing my head in. Here's what I have right now: breeds_listing.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ListView android:id="@+id/breedsListView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:dividerHeight="0px" android:divider="#00000000"><

contenteditable selected text save and restore

☆樱花仙子☆ 提交于 2019-11-27 04:31:28
问题 I came across this post that shows 2 functions on how to save and restore selected text from a contenteditable div. I have the below div set as contenteditable and the 2 function from the other post. How to i use these functions to save and restore selected text. <div style="width:300px;padding:10px;" contenteditable="true">test test test test</div> <script> function saveSelection() { if (window.getSelection) { sel = window.getSelection(); if (sel.getRangeAt && sel.rangeCount) { return sel

How to Get Selected Text and Value Android ListPreference

爷,独闯天下 提交于 2019-11-27 03:11:15
问题 The XML file of my ListPreference <ListPreference android:key="lpBirim" android:title="Birim" android:summary="" android:defaultValue="0" android:persistent="false"/> How to get the selected text and the selected value? 回答1: in your PreferenceActivity do something like: ListPreference listPreference = (ListPreference) findPreference("lpBirim"); CharSequence currText = listPreference.getEntry(); String currValue = listPreference.getValue(); 回答2: You can use this snippet to get the value:

What is the difference between the states selected, checked and activated in Android?

随声附和 提交于 2019-11-27 02:27:51
I'd like to know what differs those states. I didn't find any webpage clarifying this. Martin Harvey The difference between Checked and Activated is actually quite interesting. Even the Google documentation is apologetic (emphasis below added): ... For example, in a list view with single or multiple selection enabled, the views in the current selection set are activated. (Um, yeah, we are deeply sorry about the terminology here.) The activated state is propagated down to children of the view it is set on. So here is the difference: Activated was introduced in Honeycomb so you can't use it

how to get selected text from iframe with javascript?

我的未来我决定 提交于 2019-11-27 01:51:31
<html> <body> <script type="text/javascript"> function smth() { if (document.getSelection) { var str = document.getSelection(); if (window.RegExp) { var regstr = unescape("%20%20%20%20%20"); var regexp = new RegExp(regstr, "g"); str = str.replace(regexp, ""); } } else if (document.selection && document.selection.createRange) { var range = document.selection.createRange(); var str = range.text; } alert(str); } </script> <iframe id="my" width="300" height="225"> .....some html .... </iframe> <a href="#" onclick="smth();">AA</a> </body> </html> with smth function i can get selected text from some

UIButton: set image for selected-highlighted state

 ̄綄美尐妖づ 提交于 2019-11-26 23:29:22
I set an images for button's states Normal,Highlighted and Selected, but when the button in selected state and I press/highlight it I didn't see my highlighted image but just grayed picture. Is it possible to set an image for highlighted state when the button selected? my code: [button setImage:[UIImage imageNamed:@"normal.png"] forState:UIControlStateNormal]; [button setImage:[UIImage imageNamed:@"pressed.png"] forState:UIControlStateHighlighted]; [button setImage:[UIImage imageNamed:@"checked.png"] forState:UIControlStateSelected]; when I do: [button setSelected:YES]; and press the button,

How to set an option from multiple options or array with different values to views as selected in select box using PHP

烈酒焚心 提交于 2019-11-26 22:27:29
问题 An option value is taken from the database and included in a select box along with other options. How can I set the value taken from the database as selected? The value from the database is set as $row['value'] and equals s. In HTML the options look like so... <select name="select"> <option value='xxs'>Extra, Extra small</option> <option value='xs'>Extra small</option> <option value='s'>Small</option> <option value='m'>Medium</option> <option value='l'>Large</option> <option value='xl'>Extra

javascript selected radio

99封情书 提交于 2019-11-26 21:16:08
问题 I want to check what is the selected radio input. here is my code. <input name="u_type" type="radio" value="staff" id="u_type" checked="checked" /> Staff <input name="u_type" type="radio" value="admin" id="u_type" /> Admin <input id="add_user" name="add_user" type="button" onclick="addUser();" value="Add" class="submitButton admin_add" /> function addUser() { //how to check what is the selected radio input } thanks. 回答1: function addUser() { //how to check what is the selected radio input

Spinner does not show selected value

天涯浪子 提交于 2019-11-26 18:28:06
问题 I have implemented the spinner by populating the array list through database.I can get and show the array list in my spinner array adapter but if I select the item in spinner it does not shown in spinner?What I had mistake here? Here is my code, Spinner spinner1 = (Spinner) findViewById(R.id.prospin); ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, providerlist); adapter1.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)

Set ComboBox selected item highlight color

北慕城南 提交于 2019-11-26 17:45:35
问题 I need to change the highlight color of a ComboBox's selected item in the popup list. I've found several tutorials explaining how to do this, but all of them either use Blend, which I do not have and cannot obtain, or involve changing the system default colors--which seems like a hack to me. Can someone point me to the template I need to override, or tell me the property I need to set? 回答1: Override the SystemColors.HighlightBrushKey (and SystemColors.HighlightTextBrushKey if you want):