<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就会在项目中出现错误.
请帮忙.
我正在使用自定义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) 我只是想知道ImageView
它的设置是否可点击之间是否存在任何显着差异ImageButton
?
是否有任何理由使用一个而不是另一个?作为唯一可能的选择ImageButton
,是否有任何对drawable的限制ImageView
?
如果我选择点击ImageView
一下,我可能会失去按钮的任何功能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) 我有一个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)
我得到的图像,但没有文字.我该如何显示文字?请帮我!
如果我使用带有选择器的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)
我有一个图像按钮,点击它时没有响应触摸动画,因为它是一个静态图像,而不像棒棒糖上的常规按钮带有内置的连锁效果.我想将材料设计波纹触摸效果添加到图像中,但似乎无法找到实现它的方法.我可以在图像上设置一个滤色器,但这不是涟漪效应.我正在尝试做的一个例子就是当你在Google Play音乐中保存一个专辑封面图像并且阴影波纹在图像上移动时.
xml android imagebutton material-design android-5.0-lollipop
我可以layout.xml
使用以下方法设置ImageButton背景透明:
android:background="@android:color/transparent"
Run Code Online (Sandbox Code Playgroud)
我如何使用java代码完成同样的事情?就像是ib.setBackgroundColor(???);
在ImageButton
我想删除标准按钮背景图像.在http://developer.android.com中,据说,必须定义他自己的背景图像或将背景颜色设置为透明.我试图设置黑色背景,但它没有产生任何影响......
Button
图像ImageButton
和可点击之间有什么区别ImageView
吗?
imagebutton ×10
android ×9
button ×2
transparent ×2
background ×1
image ×1
javascript ×1
jquery-ui ×1
scale ×1
surfaceview ×1
xml ×1