android gridview控件使用详解_android tablelayout

android gridview控件使用详解_android tablelayoutfrom:http://blog.csdn.net/weich_java/article/details/6987198笔者在用GridView时发现GridView的selectstyle会根据系统而不同,因为在客户端中一边具有统一的显示风格,所以尝试了下指定GridView的选中样式。首先看一下代码:menu.xmlandroid:layout_width=”fill_parent”andr…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

from:http://blog.csdn.net/weich_java/article/details/6987198

笔者在用GridView时发现GridView的select style会根据系统而不同,因为在客户端中一边具有统一的显示风格,所以尝试了下指定GridView的选中样式。

首先看一下代码:

menu.xml

android:layout_width=”fill_parent”

android:layout_height=”fill_parent”

android:background=”#e1e7e8″

android:orientation=”vertical”>

android:id=”@+id/menu”android:layout_width=”fill_parent”android:layout_marginTop=”10dip”

android:layout_height=”fill_parent”android:numColumns=”auto_fit”

android:verticalSpacing=”10dp”android:horizontalSpacing=”10dp”

android:columnWidth=”90dp”android:stretchMode=”columnWidth”

android:gravity=”center”>

其中android:listSelector=”#e1e7e8″这句,android:listSelector的颜色值一定要和它父类容器的背景色相同,这样就不会出现选中时的黑色。

menuitem.xml

android:layout_height=”wrap_content”

android:paddingBottom=”4dip”

android:background=”@drawable/bg_alibuymenu_states”

android:layout_width=”fill_parent”>

android:id=”@+id/ItemImage”

android:layout_marginTop=”20dip”

android:layout_width=”wrap_content”

android:layout_centerHorizontal=”true”>

android:gravity=”center”

android:textColor=”@color/text_color”

android:singleLine=”true”

android:textSize=”16dip”

android:layout_below=”@+id/ItemImage”

android:layout_height=”wrap_content”

android:layout_centerHorizontal=”true”

android:id=”@+id/ItemText”>

android:background=”@drawable/bg_alibuymenu_states”这句话指定了 GridView中的元素的背景风格。

bg_alibuymenu_states.xml

在此文件中也可设置default的样式,如果需要的话。

bg_alibuybutton_selected.xml

android:endColor=”@color/button_selected_end_color”android:type=”linear”

android:angle=”90″android:centerX=”0.5″android:centerY=”0.5″/>

bg_alibuybutton_default.xml

android:endColor=”@color/button_defalut_end_color”android:type=”linear”

android:angle=”90″android:centerX=”0.5″android:centerY=”0.5″/>

0_13220101349UKC.gif

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/189770.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • String和Integer转换的大坑

    String和Integer转换的大坑今天碰到一个大坑 相信很多人也都碰到过 那就是 String 和 Integer 的相互转换 m Integer parseInt num 到最后判断的时候我用 m l getM 一直得不到我想要的结果后来在网上查了很多资料发现 Integer 类型的取值范围在 128 127 我的这个 m 是 157 所以到最后取到的数据不全最后我用 if m equals l getM 把数

    2025年7月28日
    1
  • Java集合篇:ArrayList详解

    Java集合篇:ArrayList详解

    2021年10月4日
    42
  • mac 版本 idea 2021.4激活码免费【在线破解激活】[通俗易懂]

    mac 版本 idea 2021.4激活码免费【在线破解激活】,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月16日
    73
  • centos7安装python3.8_centos python3安装

    centos7安装python3.8_centos python3安装centos7自带版本是python2.7centos8是自带python3的如果要用的3.0以上的版本需要手动安装,下载地址:https://www.python.org/ftp/python/1、先查看系统python的位置在哪儿whereispythonpython2.7默认安装是在/usr/bin目录中,切换到/usr/bin/cd/usr/bin/llpython*从下面的图中我们可以看到,python指向的是python2,python2指向的是python2.7,因此

    2022年9月25日
    0
  • menuconfig 配置选项详解

    menuconfig 配置选项详解转自:http://www.blog.chinaunix.net/uid-15887868-id-2758315.html在menuconfig中配置:详细介绍内核配置选项及删改情况第一部分:全部删除Codematurityleveloptions—>代码成熟等级选项[]Promptfordevelopmentand/orincompletecode/drivers…

    2022年6月12日
    173
  • linux强制删除只读文件夹,强制删除文件夹linux的方法是什么

    linux强制删除只读文件夹,强制删除文件夹linux的方法是什么灰烬里等你丶回答数:14479|被采纳数:22016-12-1714:18:36linux下删除文件的命令是rm;以下分两种介绍删除方法:对于目录文件的删除:#rf-rffilename对于非目录文件的删除:#rffilename之所以对于目录文件的删除加上了强制参数是因为在linux对目录文件的删除是递归式的;rm的参数如下所示:OPTIONSRemove(unlink)t…

    2022年6月13日
    35

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号