Android TV 选中高亮显示
1、开发Android TV APP, 使用遥控器选中按钮或者选着其它菜单
如果没有高亮显示,就看不出选中哪个按钮或者菜单
2、在drawable 添加 border_red.xml 设置选中高亮
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="2dp"/>
<stroke
android:color="#FF0000"
android:width="3dp" />
<solid android:color="#00FF0000" />
</shape>
3、在 layout 添加页面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" >
<RelativeLayout
android:focusable="false"
android:gravity="center"
android:layout_gravity="center"
android:clipToPadding="false"
android:clipChildren="false"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="wrap_content"> <Button
android:id="@+id/button_id_1"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:background="#303F9F"
android:focusableInTouchMode="true"
android:textColor="#FFF"
android:layout_marginTop="10dp"
android:layout_marginLeft="0dp"
android:text="按钮"
android:textSize="60dp"
/> <Button
android:id="@+id/button_id_2"
android:layout_below="@id/button_id_1"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:background="#303F9F"
android:focusableInTouchMode="true"
android:textColor="#FFF"
android:text="按钮"
android:layout_marginTop="30dp"
android:textSize="60dp"
/> <Button
android:id="@+id/button_id_3"
android:layout_width="match_parent"
android:gravity="center"
android:layout_height="wrap_content"
android:background="#303F9F"
android:layout_below="@id/button_id_2"
android:focusableInTouchMode="true"
android:textColor="#FFF"
android:text="按钮"
android:layout_marginTop="30dp"
android:textSize="60dp"
/> </RelativeLayout>
</LinearLayout>
4、添加选中高亮显示,设置焦点控制
BorderView border = new BorderView(this);
border.setBackgroundResource(R.drawable.border_red); main = (RelativeLayout) findViewById(R.id.main);
border.attachTo(main);
Android TV 选中高亮显示的更多相关文章
- android TV选中时高亮凸显效果
链接: http://pan.baidu.com/s/1pLjAFQ7 密码: xb8g <ignore_js_op> 360手机助手截图0410_18_02_01.png (335.64 ...
- Android TV上的焦点切换效果
转载:http://blog.csdn.net/wzlas111/article/details/39741091 Android TV上的焦点凸显特效相信大家都看到过,那么我们就来实现它吧,首先上张 ...
- 联发科发布全球首款搭载Android TV的智能电视系统芯片MT5595
联发科发布全球首款搭载Android TV的智能电视系统芯片MT5595 admin 资讯 01-07 1 1月7日消息,联发科宣布与Google共同开发出全世界第一个搭载Android TV操作系统 ...
- Android Tv 中的按键事件 KeyEvent 分发处理流程
这次打算来梳理一下 Android Tv 中的按键点击事件 KeyEvent 的分发处理流程.一谈到点击事件机制,网上资料已经非常齐全了,像什么分发.拦截.处理三大流程啊:或者 dispatchTou ...
- Android TV 电视调试和遥控器事件监听
Android TV 真机调试 要进行Android TV开发免不了要进行真机调试. 1.确定电视盒子和开发机器在同一局域网中 2.打开电视盒子的adb允许调试开关 3.进入adb所在文件夹进行adb ...
- Android TV开发总结(六)构建一个TV app的直播节目实例
请尊重分享成果,转载请注明出处:http://blog.csdn.net/hejjunlin/article/details/52966319 近年来,Android TV的迅速发展,传统的有线电视受 ...
- Android TV开发总结(五)TV上屏幕适配总结
前言:前面几篇总结一些TV上的小Sample,开源到GitHub:https://github.com/hejunlin2013/TVSample, 点击链接,可以持续关注.今天总结下TV上屏幕适配. ...
- Android TV开发总结(三)构建一个TV app的焦点控制及遇到的坑
转载请把头部出处链接和尾部二维码一起转载,本文出自逆流的鱼yuiop:http://blog.csdn.net/hejjunlin/article/details/52835829 前言:上篇中,&l ...
- Android TV开发总结(二)构建一个TV Metro界面(仿泰捷视频TV版)
前言:上篇是介绍构建TV app前要知道的一些事儿,开发Android TV和手机本质上没有太大的区别,屏大,焦点处理,按键处理,是有别于有手机和Pad的实质区别.今天来介绍TV中Metro UI风格 ...
随机推荐
- 初学者对ASCII编码、Unicode编码、UTF-8编码的理解
最早的计算机在设计时采用8个比特(bit)作为一个字节(byte),所以,一个字节能表示的最大的整数就是 255(二进制 11111111=十进制 255),如果要表示更大的整数,就必须用更多的字节. ...
- C#学习笔记_07_数组
07_数组 数组的声明与实例化 名词解释 数组:数组是一个容器,用来存储一系列相兼容的数据类型的变量: 实例化:声明一个数组,并且赋初始值: 数组长度:就是数组的容量,表示这个数组可以存储多少个数据: ...
- H5 坑
document.addEventListener("touchmove",function(e){e.preventDefault();},false); 防止滑动时整屏页面移动 ...
- 【Codeforces Global Round 1 C】Meaningless Operations
[链接] 我是链接,点我呀:) [题意] 给你一个a 让你从1..a-1的范围中选择一个b 使得gcd(a^b,a&b)的值最大 [题解] 显然如果a的二进制中有0的话. 那么我们就让选择的b ...
- [BZOJ 3221][Codechef FEB13] Obserbing the tree树上询问
[BZOJ 3221]Obserbing the tree树上询问 题目 小N最近在做关于树的题.今天她想了这样一道题,给定一棵N个节点的树,节点按1~N编号,一开始每个节点上的权值都是0,接下来有M ...
- toj 1421
题意:假如存在矩阵A,A[i][0] + A[i][1] + ...... + A[i][n - 1] == SR[i],A[0][j] + A[1][j] + ...... + A[n - 1][j ...
- TOYS POJ 2318 计算几何 叉乘的应用
Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 15060 Accepted: 7270 Description Calc ...
- x$bh视图
首先,这篇文章是基于如下ORACLE版本. BANNER ------------------------------------------------ Oracle Database 10g En ...
- 3.2 Piecewise Linear Interpolation(站点)
Newton Interpolation: https://www.youtube.com/watch? v=EyRQXA56asI Piecewise Linear Interpolation: h ...
- NPM 3 Beta为Windows用户带来利好消息
本文来源于我在InfoQ中文站翻译的文章,原文地址是:http://www.infoq.com/cn/news/2015/06/angular-2-react-native-roadmap 近日,np ...