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风格 ...
随机推荐
- hdu 5175 Misaki's Kiss again
Misaki's Kiss again Accepts: 75 Submissions: 593 Time Limit: 2000/1000 MS (Java/Others) Memory L ...
- 1 Ipython、Jupyter 入门
为什么使用Python进行数据分析: 1 Python大量的库为数据分析和处理提供了完整的工具集 2 比起R和Matlab等其他主要用于数据分析的编程语言,Python更全能 ...
- [cf 599C] Day at the Beach
题意:有n个数,将其分组使整个数列排序后每组中的数仍在该组中,求最多的分组数. 代码很易懂 #include <iostream> #include <algorithm> # ...
- PatentTips - Substitute virtualized-memory page tables
BACKGROUND Many computer systems utilize virtualized memory for security, stability and/or other pur ...
- Grails里DOMAIN类的一对一,一对多,多对多关系总结及集成测试
终于干完这一章节,收获很多啊. 和DJANGO有类似,也有不同. User.groovy: package com.grailsinaction class User { String loginId ...
- 【ACM】 hdu_1090_A+BII_201307261100
A+B for Input-Output Practice (II)Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/3276 ...
- 洛谷—— P2733 家的范围 Home on the Range
https://www.luogu.org/problem/show?pid=2733 题目背景 农民约翰在一片边长是N (2 <= N <= 250)英里的正方形牧场上放牧他的奶牛.(因 ...
- [MongoDB]Python 操作 MongoDB
from pymongo import MongoClient mc = MongoClient('localhost',27017) db = mc.users db.users.save({'na ...
- getAttribute for IE7
getAttribute 大部分介绍都说仅仅有一个.包含w3cschool. 事实上这种方法在iE7下有两个參数. msdn 上查到的. 简单翻一下 0 是默认情况,不区分大写和小写! 1 区分大写和 ...
- oracle capability i/o(压力測试数据库serveri/o性能)
今天是2014-04-21,今天简单仅仅说明一下怎么影响重做数据的一个因素,那就是i/o吞吐量,oracle的介质恢复依赖于i/o,假设i/o存在瓶颈,那么势必会影响备库的介质恢复. 那么i/o st ...