标签: imagebutton

如何拥有透明的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>
Run Code Online (Sandbox Code Playgroud)

这就是我试图获得透明的ImageButton以便将这些按钮放在SurfaceView上.但是,只要我在xml中包含透明线,Eclipse就会在项目中出现错误.

请帮忙.

android transparent imagebutton surfaceview

472
推荐指数
9
解决办法
28万
查看次数

jQuery UI对话框 - 缺少关闭图标

我正在使用自定义jQuery 1.10.3主题.我从主题滚筒直接下载,我故意没有改变任何东西.

我创建了一个对话框,我得到一个空的灰色方块,其中关闭图标应为: 错过关闭图标的屏幕截图

我比较了在我的页面上生成的代码:

<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>
Run Code Online (Sandbox Code Playgroud)

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>
Run Code Online (Sandbox Code Playgroud)

编辑:代码的不同部分是由jQueryUI 生成的,而不是我,所以我不能只是添加span标签而不编辑jqueryui js文件,这似乎是一个糟糕/不必要的选择,以实现正常的功能.

以下是用于生成代码部分的javascript:

this.element.dialog({
    appendTo: "#summary_container",
    title: this.title(),
    closeText: "Close",
    width: this.width,
    position: {
        my: "center top",
        at: ("center top+"+(window.innerHeight*.1)),
        collision: "none"
    },
    modal: false,
    resizable: false,
    draggable: false,
    show: "fold",
    hide: "fold", …
Run Code Online (Sandbox Code Playgroud)

javascript jquery-ui imagebutton jquery-ui-dialog

175
推荐指数
7
解决办法
11万
查看次数

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

我只是想知道ImageView它的设置是否可点击之间是否存在任何显着差异ImageButton

是否有任何理由使用一个而不是另一个?作为唯一可能的选择ImageButton,是否有任何对drawable的限制ImageView

如果我选择点击ImageView一下,我可能会失去按钮的任何功能ImageButton吗?

android imagebutton android-imageview

143
推荐指数
3
解决办法
4万
查看次数

适用于Android中的ImageButton中的图像

我的活动中有6个ImageButton,我通过我的代码设置图像(不使用xml).

我希望它们覆盖75%的按钮区域.但是,由于某些图像覆盖的区域较少,因此有些图像太大而无法适应图像按钮.如何以编程方式调整大小并显示它们?以下是截图

在此输入图像描述 下面是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"
    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_next"
    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_bottomleft"
    android:layout_marginBottom="5sp"
        android:layout_marginLeft="2sp" …
Run Code Online (Sandbox Code Playgroud)

android image scale imagebutton android-linearlayout

134
推荐指数
5
解决办法
22万
查看次数

如何在ImageButton上显示文本?

我有一个ImageButton,我想在上面显示文字和图像.但是当我尝试模拟器时:

<ImageButton 
    android:text="OK" 
    android:id="@+id/buttonok" 
    android:src="@drawable/buttonok"
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" />
Run Code Online (Sandbox Code Playgroud)

我得到的图像,但没有文字.我该如何显示文字?请帮我!

android imagebutton

120
推荐指数
3
解决办法
19万
查看次数

具有选定状态的Android ImageButton?

如果我使用带有选择器的ImageButton作为其背景,是否有一种状态我可以改变它会改变它的外观?现在我可以让它在按下时更改图像,但似乎没有"突出显示"或"选中"或类似状态,这让我可以随意切换其外观.

这是我的XML; 它只会在按下时改变外观.

 <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" android:state_pressed="true" android:drawable="@drawable/map_toolbar_details_selected" />
<item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/map_toolbar_details_selected" />
<item android:drawable="@drawable/map_toolbar_details" />
Run Code Online (Sandbox Code Playgroud)

android button imagebutton

81
推荐指数
3
解决办法
13万
查看次数

应用Material Design Touch Ripple到ImageButton?

我有一个图像按钮,点击它时没有响应触摸动画,因为它是一个静态图像,而不像棒棒糖上的常规按钮带有内置的连锁效果.我想将材料设计波纹触摸效果添加到图像中,但似乎无法找到实现它的方法.我可以在图像上设置一个滤色器,但这不是涟漪效应.我正在尝试做的一个例子就是当你在Google Play音乐中保存一个专辑封面图像并且阴影波纹在图像上移动时.

xml android imagebutton material-design android-5.0-lollipop

81
推荐指数
4
解决办法
4万
查看次数

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

我可以layout.xml使用以下方法设置ImageButton背景透明:

android:background="@android:color/transparent"
Run Code Online (Sandbox Code Playgroud)

我如何使用java代码完成同样的事情?就像是ib.setBackgroundColor(???);

android background transparent imagebutton

77
推荐指数
4
解决办法
12万
查看次数

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

ImageButton我想删除标准按钮背景图像.在http://developer.android.com中,据说,必须定义他自己的背景图像或将背景颜色设置为透明.我试图设置黑色背景,但它没有产生任何影响......

android imagebutton

77
推荐指数
5
解决办法
4万
查看次数

67
推荐指数
3
解决办法
3万
查看次数