制作的RelativeLayout和它的孩子我的即时情况下ImageView的行为像一个按钮 [英] Make a relativeLayout and it's child im my case an imageview act like one button

查看:202
本文介绍了制作的RelativeLayout和它的孩子我的即时情况下ImageView的行为像一个按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

喜IM试图完成以下布局。

Hi im trying to accomplish the following layout.

我有两个RelativeLayout的,每一个都包含一个TextView和ImageView的。

I have two RelativeLayout, each one contains a TextView and an ImageView.

在ImageView的展现给用户的选择,他挑!这两个图片详细解释什么,我想要做的:

the imageView show to the user the choice that he picked!!.These two picture explains more what i want to do:

本图片展示了第UI,没有点击事件的正常状态。当在布局中自下而上布局届ImageView的用户点击将被设置为不可见,并在布局底部的图像视图出现显示到第二个选择是由用户选择了用户。我没有觉得很难处理这个问题(相对布局设置点击监听器和处理的ImageView的可见性)。

This Picture show th normal state of the ui, no click events. When user click on the bottom layout th imageview in layout top will be set to invisible and the the image view in layout bottom appear showing to the user that the second choice was picked by the user. I didn't find it difficult to deal with this issue (setting click listener on relative layout and handle the visibility of imageview).

这是IM面对的是如何让所有的相对布局的行为像一个按钮,当相对布局点击它的问题将变为蓝色,同时在ImageView的变成白!

the problem that im facing is how to make all the relative layout act like one button " when relative layout is clicked it turns to blue at the same time the imageview turns to white!!

总之我会说我怎么可以在这两个选择同步!

In short i would say how can i synchronize the two selector!!

推荐答案

设置你的孩子认为Android的财产:duplicateParentState =真正的

Set the property of you child view android:duplicateParentState="true"

<一个href=\"http://developer.android.com/reference/android/view/View.html#attr_android%3aduplicateParentState\"相对=nofollow> duplicateParentState

这篇关于制作的RelativeLayout和它的孩子我的即时情况下ImageView的行为像一个按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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