Tag: imagebutton

Imagebutton更改编程?

我试图以编程方式更改ImageButton的图像。 我试图复制这段代码,但是setBackgroundDrawable已经被弃用了。 public void giveClue(View view) { Drawable replacer = getResources().getDrawable(R.drawable.icon2); ((ImageButton) view).setEnabled(false); ((ImageButton) view).setBackgroundDrawable(replacer); gameAdapter.giveClue(game); } 我的button是使用xml创build的,如下所示: <ImageButton android:id="@+id/ImageButton2" android:layout_width="24dp" android:layout_height="22dp" android:layout_alignTop="@+id/imageButton1" android:layout_toLeftOf="@+id/ImageButton3" android:src="@drawable/icon" android:onClick="giveClue"/> 请帮忙。 谢谢。

应用材质devise触摸纹波到ImageButton?

我有一个图像button,它不响应点击时的触摸animation,因为它是一个静态图像,不像棒棒糖上的内置涟漪效应。 我想添加材料devise涟漪触摸效果的形象,但似乎无法find一个方法来实现它。 我可以在图像上设置一个颜色filter,但这不是涟漪效应。 我试图做的一个例子是,当您在Google Play音乐中放置相册封面图片时,图片上会出现阴影涟漪。

如何在代码中设置图像button的透明背景?

我可以在layout.xml使用ImageButton背景透明: android:background="@android:color/transparent" 如何使用java代码来实现同样的function? 像ib.setBackgroundColor(???);

button与图像,ImageButton和可点击的ImageView之间的区别?

Button与图像, ImageButton和可点击的ImageView有什么区别吗?

如何删除ImageButton的标准背景图片?

在ImageButton我想删除标准的button背景图片。 在http://developer.android.com ,据说,必须定义他自己的背景图像或设置背景颜色是透明的。 我试图设置一个黑色的背景,但它没有任何效果…

如何显示ImageButton上的文字?

我有一个ImageButton,我想要显示一个文本和图像。 但是当我尝试 <ImageButton android:text="OK" android:id="@+id/buttonok" android:src="@drawable/buttonok" android:layout_width="match_parent" android:layout_height="wrap_content"/> 我在模拟器上得到的button有图像,但没有文字。 我如何显示文本,请帮助我!

可点击的ImageView和ImageButton之间的区别

我只是想知道是否有一个ImageView被设置为可点击,与ImageButton比较之间有任何显着差异? 是否有任何理由使用其中一个? ImageButton的drawable是否有任何限制,使ImageView成为唯一可能的选项? 如果我selectImageButton的可点击的ImageView ,我可能会失去一个button的function吗?

jQuery UI对话框 – 缺lessclosures图标

我正在使用自定义的jQuery 1.10.3主题。 我从主题滚轮下载了每一个笔直的内容,而且我故意没有改变任何东西。 我创build一个对话框,我得到一个空的灰色广场,closures图标应该是: 我比较了在我的页面上生成的代码: <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> 到在Dialog Demo页面上生成的代码: <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"> <span id="ui-id-1" class="ui-dialog-title">Basic dialog</span> <button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close" role="button" aria-disabled="false" title="close"> <span class="ui-button-icon-primary ui-icon ui-icon-closethick"></span> <span class="ui-button-text">close</span> </button> </div> 编辑:代码的不同部分是由jQueryUI 生成的,不是我,所以我不能只是添加span标签没有编辑jqueryui js文件,这似乎是一个坏/不必要的select,以实现正常的function。 以下是用于生成代码部分的JavaScript: this.element.dialog({ appendTo: "#summary_container", title: this.title(), closeText: "Close", […]

如何有一个透明的ImageButton:Android

<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> 这是我试图得到一个透明的ImageButton,以便将这些button放在SurfaceView上。 但是,Eclipse,只要我在xml中包含透明线,就给我一个项目的错误。 请帮忙。

在Android中的ImageButton中调整图像

我在我的活动中有6个ImageButton,我通过我的代码设置图像(不使用XML)。 我希望他们覆盖button区域的75%。 但是,如果一些图像覆盖的面积较小,有些太大而不适合imageButton。 如何以编程方式resize并显示它们? 以下是屏幕截图 下面是xml文件 <?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" android:layout_marginRight="5sp" android:layout_marginTop="0sp" > <LinearLayout android:layout_height="0dp" android:layout_width="match_parent" android:layout_weight="1" android:orientation="horizontal"> <ImageButton android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="1" android:id="@+id/button_topleft" android:layout_marginBottom="5sp" android:layout_marginLeft="2sp" android:layout_marginRight="5sp" android:layout_marginTop="0sp" /> <ImageButton android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="1" android:id="@+id/button_topright" android:layout_marginBottom="5sp" android:layout_marginLeft="2sp" android:layout_marginRight="5sp" android:layout_marginTop="0sp" /> </LinearLayout> <LinearLayout android:layout_height="0dp" android:layout_width="match_parent" android:layout_weight="1" android:orientation="horizontal"> <ImageButton android:layout_height="match_parent" android:layout_width="0dp" android:layout_weight="1" android:id="@+id/button_repeat" […]