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风格 ...
随机推荐
- 一次vue-cli 2.x项目打包优化经历(优化xlsx插件)
一.分析各模块打包后大小 用vue-cli创建的项目,已经集成 webpack-bundle-analyzer.详见文件 build/webpack.prod.conf.js,代码如下: if (co ...
- Python 5 运算符
数学运算符: + 加 1 + 1 = 2 - 减 2 - 1 = 1 × 乘 2 × 2 = 4 / 除 3 / 2 = 1.5 不同版本可能显示小数位数不同 ...
- vs2005添加include lib文件目录
vs2005添加include lib文件目录 http://blog.sina.com.cn/s/blog_79489160010145wb.html 1. 添加编译所需要的 lib 文件 [解决方 ...
- Lifting the Stone 计算几何 多边形求重心
Problem Description There are many secret openings in the floor which are covered by a big heavy sto ...
- U - Palindrome Manacher
Andy the smart computer science student was attending an algorithms class when the professor asked t ...
- HDU4882ZCC Loves Codefires(贪心)
ZCC Loves Codefires Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- POJ 3748:位操作
位操作 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8964 Accepted: 3581 Description 如 ...
- 我的Android进阶之旅------>Android中ListView中嵌套(ListView)控件时item的点击事件不起作的问题解决方法
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvb3V5YW5nX3Blbmc=/font/5a6L5L2T/fontsize/400/fill/I0JBQk ...
- 腾讯面试题:A.txt和B.txt两个文件,A有1亿个qq号,B有100万个,用代码实现交、并、差
在STL中关于有序序列有这么四个算法: set_union(beg, end, beg, end2, dest); //求并集A∪B set_union(beg, ...
- Java集合类汇总记录--guava篇
BiMap HashBiMap<K,V> 实现了两份哈希表数据结构(本类独立实现).分别负责两个方向的映射. EnumBiMap<K,V> 两个EnumMap对象分别负责两个方 ...