我只是检查设计指南并想知道无边框按钮.我瞪着眼睛,试图在源头找到但不能自己把它整合在一起.这是普通的Button小部件,但是您添加了自定义(Android默认)样式吗?如何制作这些无边框按钮(当然你可以将背景设置为空,但后来我没有分隔线)?
这里链接到设计指南:

我不想成为第三个问这个问题的人,但前两个 问题似乎没有完全回答.Android设计指南详细介绍了无边框按钮,但没有详细说明如何制作它们.在之前的一个答案中,有一个消息使用:
style="@android:style/Widget.Holo.Button.Borderless"
这适用于Holo主题,但我也使用了很多Holo.Light
style="@android:style/Widget.Holo.Light.Button.Borderless"
似乎不存在.有没有办法在Holo.Light中应用这种无边框按钮的样式,或者更好的是,只需应用无边框标签而不指定它所属的主题,这样应用程序可以在运行时选择合适的样式?
Holo.ButtonBar似乎适合我正在寻找的账单,除了它没有提供用户反馈它被按下.
此外,文档中是否有一个位置列出了可以应用的样式以及它们的描述?无论我谷歌多少,搜索文档,我都找不到任何东西.如果我右键单击并编辑样式,则只有一个非描述性列表.
任何帮助,将不胜感激.
编辑:从javram得到了一个完美的答案,我想为有兴趣添加谷歌采用的部分边界的人添加一些XML.
Fora水平分隔线,这个效果很好
<View
android:id="@+id/horizontal_divider_login"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/holo_blue" />
Run Code Online (Sandbox Code Playgroud)
这是一个垂直的:
<View
android:id="@+id/vertical_divider"
android:layout_width="1dip"
android:layout_height="match_parent"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:background="@color/holo_blue" />
Run Code Online (Sandbox Code Playgroud) 我需要有一些文字与左边被拉伸,我想,当用户点击/触摸图像(仅图像,而不是文字)来执行一些代码,所以我用了一个LinearLayout中具有的TextView和ImageView的是可点击并启动onClick事件.XML解析器建议我用带有复合drawable的TextView替换它,这将用更少的XML行绘制相同的东西.我的问题是"我可以指定我只想在on drawable上处理onClick事件TextView而不是TextView本身?我见过一些解决方案,包括编写你自己的TextView扩展,但我只对能够在布局资源中做到这一点感兴趣,如果可能的话,我会保留以下内容XML代码:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="bottom"
android:paddingTop="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="@string/home_feedback_title"
android:textColor="@android:color/primary_text_dark"
android:textStyle="bold"
android:paddingBottom="4dp"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/action_feedback"
android:clickable="true"
android:onClick="onClickFeedback"
android:contentDescription="@string/action_feedback_description"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud) 我正在开发和Android应用程序.我有一个包含大量图像按钮的主菜单,每个图像按钮都会让用户点击一个新视图.
我遇到的问题是每个图标周围都是一个有色矩形,当点击时会变成淡蓝色.如何在.xml布局文件中删除此透明方块?
提前谢谢了,
android ×4
borderless ×1
button ×1
imagebutton ×1
layout ×1
onclick ×1
styles ×1
textview ×1
view ×1