1.软文推荐

2.软文推荐

3.软文推荐

目录: 1、Android怎么生成设备节点 2、Element-UI tree 组件 选中节点高亮的问题处理 3、这个百度网盘的标题栏 怎么用HTML写啊 谢谢 Android怎么生成设备节点

Android如何生成设备节点在Android中,由于没有mdev和udev,所以它没有办法动态的生成设备节点,那么它是如何做的呢?我们可以在system/core/init/下的init.c和devices.c中找到答案:init.c中int main(int argc, char **argv) { ... /* Get the basic filesystem setup we need put * together in the initramdisk on / and then we'll * let the rc file figure out the rest. */ mkdir("/dev", 0755); mkdir("/proc", 0755); mkdir("/sys", 0755); mount("tmpfs", "/dev", "tmpfs", 0, "mode=0755"); mkdir("/dev/pts", 0755); mkdir("/dev/socket", 0755); mount("devpts", "/dev/pts", "devpts", 0, NULL); mount("proc", "/proc", "proc", 0, NULL); mount("sysfs", "/sys", "sysfs", 0, NULL); for() { ... if (ufds[0].revents == POLLIN) handle_device_fd(device_fd); if (ufds[1].revents == POLLIN) handle_property_set_fd(property_set_fd); if (ufds[3].revents == POLLIN) handle_keychord(keychord_fd); } return 0; } 我们再来看看handle_device_fd(),该函数定义在devices.c中void handle_device_fd(int fd) { ... handle_device_event(uevent); handle_firmware_event(uevent); } } 而handle_device_event定义如下:static void handle_device_event(struct uevent *uevent) { ... if(!strcmp(uevent-action, "add")) { make_device(devpath, block, uevent-major, uevent-minor); return; } ... } make_device定义如下:static void make_device(const char *path, int block, int major, int minor) { ... mode = get_device_perm(path, uid, gid) (block S_IFBLK : S_IFCHR); dev = (major $amp; ... setegid(gid); mknod(path, mode, dev); chown(path, uid, -1); setegid(AID_ROOT); } 我们看看get_device_perm如下实现:static mode_t get_device_perm(const char *path, unsigned *uid, unsigned *gid) { mode_t perm; if (get_device_perm_inner(qemu_perms, path, uid, gid, perm) == 0) { return perm; } else if (get_device_perm_inner(devperms, path, uid, gid, perm) == 0) { return perm; } else { struct listnode *node; struct perm_node *perm_node; struct perms_ *dp; /* Check partners list. */ list_for_each(node, devperms_partners) { perm_node = node_to_item(node, struct perm_node, plist); dp = perm_node-dp; if (dp-prefix) { if (strncmp(path, dp-name, strlen(dp-name))) continue; } else { if (strcmp(path, dp-name)) continue; } /* Found perm in partner list. */ *uid = dp-uid; *gid = dp-gid; return dp-perm; } /* Default if nothing found. */ *uid = 0; *gid = 0; return 0600; } } 我们最后可以看到在devperms中定义了要生成的设备节点:static struct perms_ devperms[] = { { "/dev/null", 0666, AID_ROOT, AID_ROOT, 0 }, { "/dev/zero", 0666, AID_ROOT, AID_ROOT, 0 }, { "/dev/full", 0666, AID_ROOT, AID_ROOT, 0 }, { "/dev/ptmx", 0666, AID_ROOT, AID_ROOT, 0 }, { "/dev/tty", 0666, AID_ROOT, AID_ROOT, 0 }, { "/dev/random", 0666, AID_ROOT, AID_ROOT, 0 }, { "/dev/urandom", 0666, AID_ROOT, AID_ROOT, 0 }, { "/dev/ashmem", 0666, AID_ROOT, AID_ROOT, 0 }, { "/dev/binder", 0666, AID_ROOT, AID_ROOT, 0 }, /* logger should be world writable (for logging) but not readable */ { "/dev/log/", 0662, AID_ROOT, AID_LOG, 1 }, /* the msm hw3d client device node is world writable/readable. */ { "/dev/msm_hw3dc", 0666, AID_ROOT, AID_ROOT, 0 }, /* gpu driver for adreno200 is globally accessible */ { "/dev/kgsl", 0666, AID_ROOT, AID_ROOT, 0 }, /* these should not be world writable */ { "/dev/diag", 0660, AID_RADIO, AID_RADIO, 0 }, { "/dev/diag_arm9", 0660, AID_RADIO, AID_RADIO, 0 }, { "/dev/android_adb", 0660, AID_ADB, AID_ADB, 0 }, { "/dev/android_adb_enable", 0660, AID_ADB, AID_ADB, 0 }, { "/dev/ttyMSM0", 0600, AID_BLUETOOTH, AID_BLUETOOTH, 0 }, { "/dev/ttyHS0", 0600, AID_BLUETOOTH, AID_BLUETOOTH, 0 }, { "/dev/uinput", 0660, AID_SYSTEM, AID_BLUETOOTH, 0 }, { "/dev/alarm", 0664, AID_SYSTEM, AID_RADIO, 0 }, { "/dev/tty0", 0660, AID_ROOT, AID_SYSTEM, 0 }, { "/dev/graphics/", 0660, AID_ROOT, AID_GRAPHICS, 1 }, { "/dev/msm_hw3dm", 0660, AID_SYSTEM, AID_GRAPHICS, 0 }, { "/dev/input/", 0660, AID_ROOT, AID_INPUT, 1 }, { "/dev/eac", 0660, AID_ROOT, AID_AUDIO, 0 }, { "/dev/cam", 0660, AID_ROOT, AID_CAMERA, 0 }, { "/dev/pmem", 0660, AID_SYSTEM, AID_GRAPHICS, 0 }, { "/dev/pmem_adsp", 0660, AID_SYSTEM, AID_AUDIO, 1 }, { "/dev/pmem_camera", 0660, AID_SYSTEM, AID_CAMERA, 1 }, { "/dev/oncrpc/", 0660, AID_ROOT, AID_SYSTEM, 1 }, { "/dev/adsp/", 0660, AID_SYSTEM, AID_AUDIO, 1 }, { "/dev/snd/", 0660, AID_SYSTEM, AID_AUDIO, 1 }, { "/dev/mt9t013", 0660, AID_SYSTEM, AID_SYSTEM, 0 }, { "/dev/msm_camera/", 0660, AID_SYSTEM, AID_SYSTEM, 1 }, { "/dev/akm8976_daemon",0640, AID_COMPASS, AID_SYSTEM, 0 }, { "/dev/akm8976_aot", 0640, AID_COMPASS, AID_SYSTEM, 0 }, { "/dev/akm8973_daemon",0640, AID_COMPASS, AID_SYSTEM, 0 }, { "/dev/akm8973_aot", 0640, AID_COMPASS, AID_SYSTEM, 0 }, { "/dev/bma150", 0640, AID_COMPASS, AID_SYSTEM, 0 }, { "/dev/cm3602", 0640, AID_COMPASS, AID_SYSTEM, 0 }, { "/dev/akm8976_pffd", 0640, AID_COMPASS, AID_SYSTEM, 0 }, { "/dev/lightsensor", 0640, AID_SYSTEM, AID_SYSTEM, 0 }, { "/dev/msm_pcm_out", 0660, AID_SYSTEM, AID_AUDIO, 1 }, { "/dev/msm_pcm_in", 0660, AID_SYSTEM, AID_AUDIO, 1 }, { "/dev/msm_pcm_ctl", 0660, AID_SYSTEM, AID_AUDIO, 1 }, { "/dev/msm_snd", 0660, AID_SYSTEM, AID_AUDIO, 1 }, { "/dev/msm_mp3", 0660, AID_SYSTEM, AID_AUDIO, 1 }, { "/dev/audience_a1026", 0660, AID_SYSTEM, AID_AUDIO, 1 }, { "/dev/tpa2018d1", 0660, AID_SYSTEM, AID_AUDIO, 1 }, { "/dev/msm_audpre", 0660, AID_SYSTEM, AID_AUDIO, 0 }, { "/dev/msm_audio_ctl", 0660, AID_SYSTEM, AID_AUDIO, 0 }, { "/dev/htc-acoustic", 0660, AID_SYSTEM, AID_AUDIO, 0 }, { "/dev/vdec", 0660, AID_SYSTEM, AID_AUDIO, 0 }, { "/dev/q6venc", 0660, AID_SYSTEM, AID_AUDIO, 0 }, { "/dev/snd/dsp", 0660, AID_SYSTEM, AID_AUDIO, 0 }, { "/dev/snd/dsp1", 0660, AID_SYSTEM, AID_AUDIO, 0 }, { "/dev/snd/mixer", 0660, AID_SYSTEM, AID_AUDIO, 0 }, { "/dev/smd0", 0640, AID_RADIO, AID_RADIO, 0 }, { "/dev/qemu_trace", 0666, AID_SYSTEM, AID_SYSTEM, 0 }, { "/dev/qmi", 0640, AID_RADIO, AID_RADIO, 0 }, { "/dev/qmi0", 0640, AID_RADIO, AID_RADIO, 0 }, { "/dev/qmi1", 0640, AID_RADIO, AID_RADIO, 0 }, { "/dev/qmi2", 0640, AID_RADIO, AID_RADIO, 0 }, /* CDMA radio interface MUX */ { "/dev/ts0710mux", 0640, AID_RADIO, AID_RADIO, 1 }, { "/dev/ppp", 0660, AID_RADIO, AID_, 0 }, { "/dev/tun", 0640, AID_, AID_, 0 }, { NULL, 0, 0, 0, 0 }, };

Element-UI tree 组件 选中节点高亮的问题处理

最近新做的项目,有用到Element-UI tree 组件,需求是选中的节点背景颜色改变(默认的太浅了),并且要求不切换的情况下一直保持高亮

由于项目的树比较多,我写了两种

1.点击后高亮显示的背景颜色修改(但是不能一直保持不变)

.el-tree-node:focus .el-tree-node__content {

background-color: rgb(158, 213, 250) !important;

}

这个只要改变css就可以达到效果

2.点击后显示高亮的效果,并且不切换的情况下高亮一直保持

css:

.el-tree--highlight-current .el-tree-node.is-current.el-tree-node__content{

background-color: rgb(158, 213, 250) !important;

}

js:

node-key="id"表示使用每个节点的"id"对应的值来表示每个节点

highlight-current"表示高亮选中的节点

这样就能让点击选中的节点保持高亮,在不切换的情况下一直高亮这个百度网盘的标题栏 怎么用HTML写啊 谢谢

这个不是HTML代码写的,这个只是一个图片,其实很多网站的logo都是一个图片不是用HTML代码写的,要是想知道该标题是不是图片可以右键就能发现标题是不是图片了。

查看1:

查看2:

1、

2、

相关文章 8

1

百度高权重域名购买要注意什么?(百度高权重域名改客标题,直接在百度搜不到了) 1分钟前

寻找百度高权重域名找到域名注册的平台进入筛选出符合条件的域名即可,那么购买百度高权重域名要注意什么呢?下面是有关百度高权重...

2

云服务器哪家好(香港云服务器哪家好) 4分钟前

云服务器哪家好?目前提供云服务器的平台非常多,有的品牌响亮,有的价格低,有的售后服务好。在购买云服务器时,如果不知道如何选...

3

Godaddy云服务器简介(godaddy 服务器) 5分钟前

描述一个云服务器的最好的方式是说他们的不同之处。对于传统的独立主机而言,你的可用空间是受到硬件限制的,用完了你必须重新购买...

4

企业级ssl证书价格(企业型ssl证书) 6分钟前

目录:1、企业级SSL证书买哪种品牌的SSL证书好?2、微信小程序要求HTTPS请求,如何选择SSL证书3、如何去选择SSL证书?4、IP ssl证书该怎么选...

5

Elementor教程:如何在WordPress中创建侧边栏(elementor怎么用) 8分钟前

Elementor是WordPress的一款可视化页面构建器插件,您可以通过该插件拖拽式设计和生成网页,不需要掌握专业的编程知识,操作非常简单。使...

6

网站公司网站制作需要注意什么?如何选择公司(网站建设制) 11分钟前

??公司在建设网站的时候,必须要明确公司的发展方向,从宣传公司产品的角度入手,这样才能搭建一个优质的公司网站。那么网站公司网站...

7

动态网站有什么特点 动态网站设计原则是什么(动态网站的概念) 12分钟前

??现在互联网上的网站多不胜数,这些网站总体上可以分为静态网站和动态网站两种类型。接下来就和大家一起来了解动态网站有什么特点,...

8

aipage建站(AIPage) 14分钟前

目录:1、AIPage智能建站三级页面如何返回到二级页面?2、百度智能建站平台导航下图片怎么更换3、使用百度aipage智能建站,PC版怎么转换为...