机器人:设置点击标签的颜色到的TableRow的背景颜色 [英] android: Set clicked color of Tab to background color of a TableRow

查看:371
本文介绍了机器人:设置点击标签的颜色到的TableRow的背景颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个TabLayout。在那我有动态添加行的tablelayout。
当选择的TableRow /点击我要设置它的背景色为pressing或Tab键单击的的颜色。

I have a TabLayout. In that I have a tablelayout with dynamically added rows. When a TableRow is selected/clicked I want to set its background color to the Pressing or Clicked color of Tab.

我不想设置任何静态颜色,但要使用的默认主题颜色。如何获得Tablayout的颜色信息?

I don't want to set any static color but want to use the default theme color. How to get the color info of Tablayout ?

如何处理标签的左边和右边?这是设置tab_background.xml为TH backgroundRsourse所有选项卡是我所得到begore后:

How to handle the left and right side of the tabs ? This is what I get begore and after setting the tab_background.xml as th backgroundRsourse for all tabs :

在左手侧,两个图像都没有任何设置,但在左右角是光滑的。
在右手边,两个图像与setings,看所选标签的边角都只是一个正方形,他们应四舍五入或smoth喜欢的,无需任何设置。
看来我得使用tab_selected_bar_right和tab_selected_bar_left。我让他们复制到我的绘制,但不能做出来我怎么使用它们。给什么设置的int XML低于@mudit提供。

On the left hand side, both the images are without any settings, but the right and left corners are smooth. On right hand side, both images are with setings, see the corners of selected tabs are just a square, they should be rounded off or smoth like the ones without any settings. It seems I got to use tab_selected_bar_right and tab_selected_bar_left. I have copied them to my drawable, but can't make out how do I use them. What settings to give int the xml below provided by @mudit.

请指引我。任何帮助是非常AP preciated。我有急事。

Please guide me. Any help is highly appreciated. I am in a hurry.

感谢

推荐答案

上午解决了这个问题。我道歉不早提它。对不起,我只是错过了。
@Yugandhar,感谢您的关注。

Am solved with this issue. I apology for not mentioning it earlier. Sorry, I just missed out. @Yugandhar, Thanks for your interest.

这篇关于机器人:设置点击标签的颜色到的TableRow的背景颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆