imagebutton

Android Set ImageButton as Toggle

…衆ロ難τιáo~ 提交于 2019-11-27 00:30:58
问题 How can I have an imagebutton stay in the 'pressed' state when it is clicked? Basically I just want the background to be the depressed background, but I can't figure out how to set it. At the moment, I've just copied the selected button background into my res folder, but when I set it as the background, it becomes blurry (since the original image is bigger than the button itself). Normal Background: alt text http://img707.imageshack.us/img707/9199/ss20100426163452.png What I'm getting: alt

jQuery UI Dialog - missing close icon

偶尔善良 提交于 2019-11-26 23:32:25
I'm using a custom jQuery 1.10.3 theme. I downloaded every straight from the theme roller and I have intentionally not changed anything. I create a dialog box and I get an empty gray square where the close icon should be: I compared the code that is generated on my page: <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"> <spanid="ui-id-2" class="ui-dialog-title">Title</span> <button class="ui-dialog-titlebar-close"></button> </div> to the code generated on the Dialog Demo page : <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">

How to have a transparent ImageButton: Android

旧城冷巷雨未停 提交于 2019-11-26 19:16:48
<ImageButton android:id="@+id/previous" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/media_skip_backward" android:background="@drawable/transparent"></ImageButton> This is what I tried to get a transparent ImageButton so as to place those buttons on a SurfaceView. But Eclipse, gives me an error in the project as soon as I include the transparent line in xml. Please help. Try using null for the background ... android:background="@null" DON'T USE A TRANSAPENT OR NULL LAYOUT because then the button (or the generic view) will no more highlight at

Rounded corners android image buttons

不打扰是莪最后的温柔 提交于 2019-11-26 18:28:19
问题 I am trying to round corners on an android ImageButton, the code looks like this; <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id

Fit Image in ImageButton in Android

五迷三道 提交于 2019-11-26 18:10:45
I have 6 ImageButton in my activity, I set images through my code in them ( not using xml). I want them to cover 75% of the button area. But where as some images cover less area, some are too big to fit into the imageButton. How to programatically resize and show them? Below is the screen shot below is the xml-file <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:layout_marginBottom="5sp" android:layout_marginLeft="2sp"

How to use setImageUri() on Android

一个人想着一个人 提交于 2019-11-26 17:22:42
问题 Can you help me please? I've tried : ImageButton imgbt=(ImageButton)findViewById(R.id.imgbutton); Uri imgUri=Uri.parse("/data/data/MYFOLDER/myimage.png"); imgbt.setImageUri(imgUri); but I didn't see anything, simply a void button. 回答1: ImageView.setImageUri only works for local Uri, ie a reference to a local disk file, not a URL to an image on the network. Here is an example of how to fetch a Bitmap from the network. private Bitmap getImageBitmap(String url) { Bitmap bm = null; try { URL aURL

can't click on listview row with imagebutton

我是研究僧i 提交于 2019-11-26 16:07:35
I have trouble with listview. its items (rows) have imagebutton. imagebutton has "android:onClick" so this onclick event is working, but click on row doesnt work. if i remove imagebutton from row item, click on row works (listview has correct onclick listner). How can i fix it ? i need onclick event when user click on imagebutton and standart click event, when user select row (not click the imagebutton but click the row) my listview: <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/restaurants_list" android:layout_width="fill_parent" android:layout_height=

How to disable submit behaviour of asp:ImageButton?

。_饼干妹妹 提交于 2019-11-26 14:45:28
问题 I have a image button in a page which can be triggered on mouse click, by default it gets triggered on enter press also which i want to disable. I know about "UseSubmitBehaviour" attribute in asp:Button, is there a way to do the same in asp:ImageButton? 回答1: I will assume you have some sort of input controls and you don't want an enter keypress to auto submit when a user accident hits the enter key. If so you can attach a javascript onkeypress event to each control that you want to disable

Android ImageButton with a selected state?

心不动则不痛 提交于 2019-11-26 11:34:41
If I was using an ImageButton with a selector for its background, is there a state I can change which will make it change its appearance? Right now I can get it to change images when pressed, but there seems to be no "highlighted" or "selected" or similar state which lets me toggle its appearance at will. Here's my XML; it only changes appearance when pressed. <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/map_toolbar_details_selected" /> <item android:state_focused="true"

How do I keep the aspect ratio on image buttons in android?

拜拜、爱过 提交于 2019-11-26 09:28:32
问题 I have 5 square ImageButtons that I want to have lined up side by side on the bottom of the screen. I have each one set (different id\'s) as: <ImageButton android:id=\"@+id/box1\" android:layout_width=\"fill_parent\" android:layout_height=\"wrap_content\" android:layout_gravity=\"center\" android:adjustViewBounds=\"true\" android:scaleType=\"fitXY\" android:layout_weight=\"1\" android:layout_margin=\"1dp\" /> and I have the background assigned in main java like this: int[] imageIds = new int[