如何打开子窗口上单击列表项的三个按钮一样显示在红色正方形屏幕截图 [英] How open sub window with three buttons on clicked list item like shown in screenshot with red square
问题描述
我要打开点击列表项的子窗口。该窗口包含三个按钮,这些也可点击。见截图。
I have to open a sub window on clicked list item. This window contain three buttons these are also clickable. See Screenshot.
在iphone,能够使用的TableRow。有没有办法像iPhone或任何方式不同的Android
In iphone it is possible using TableRow. Is there way in android like iphone or any different way
推荐答案
创建您的布局,包括要显示在列表项点击此扩展视图
create you layout including this expanded View that you want to show on ListItem Click
添加以下code到你的听众LISTViewclick这里居然要使其可见
add the following code to Your LISTViewclick listener where actually want to make it visible
Count是一个变量,以检查是否它被点击次数是偶数或奇数
以便使其可见,并相应地不可见。
Count is a variable to check if number of times it is clicked is even or odd so as to make it visible and invisible accordingly.
IF((count%2)==0)
{
linearLayout.setvisibilty(View.GONE);
}
else
{
linearLayout.setvisibilty(View.VISIBLE);
}
的LinearLayout
这里是在屏幕截图您所需的布局......(设计,布局和使用它的父布局的可见性设置为 GONE
)
它在起点设置为不可见。并在其itemClick在可见的相应
set it to invisible at the starting. and make it visible on itemclick accordingly
给你一个粗略的想法,你可以相应地定制code
giving you a rough idea you can customize the code accordingly
希望它帮助。我曾用同样的招数很多时间做这样的事情发生。
Hope it helps. I had used same tricks many time to make such things happen
这篇关于如何打开子窗口上单击列表项的三个按钮一样显示在红色正方形屏幕截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!