小编mdv*_*mdv的帖子

在Android中捕获按钮发布

是否可以捕获按钮的释放,就像我们使用onClickListener()和捕获点击一样OnClick()

我希望在按下按钮时增加按钮的大小,并在释放按钮时将其移回原始大小.任何人都可以帮我怎么做?

android button

28
推荐指数
1
解决办法
2万
查看次数

禁用和灰显列表项

我有一个列表视图.在该列表视图中,我必须灰显并禁用某些项目,并启用具有单独颜色的其余列表项目.这该怎么做?

android

5
推荐指数
1
解决办法
3511
查看次数

关于getView()的问题

任何人都可以解释以下代码的作用吗?

  public View getView(int position, View convertView, ViewGroup parent) {

   // TODO Auto-generated method stub
   View myView = null;
   try {
    myView = convertView;
    if (null == myView) {
     LayoutInflater li = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);

     myView = li.inflate(R.layout.demographic_list_item, null);

    }
    if (mScan_listItems[position] != null) {
     // read the values and attach them.
     TextView tv1 = (TextView) myView
       .findViewById(R.id.DemoGraphicItem_Text);

     tv1.setText(mScan_listItems[position]);

    }

   } catch (Exception e) {
    e.printStackTrace();
   }

   return myView;
  }

 }
Run Code Online (Sandbox Code Playgroud)

android

4
推荐指数
1
解决办法
3536
查看次数

eclipse文本格式化程序

我在eclipse中写了一些代码,里面有很多空行.我需要格式化代码并删除空行.我该怎么做?

eclipse

3
推荐指数
1
解决办法
6430
查看次数

c ++中的多个三元运算符

我对以下场景(C++)有疑问:

说,我有一个if条件

if ( a ? b ? c : d : false)
{
    // do something
}
else
{
    // do something else
}
Run Code Online (Sandbox Code Playgroud)

这是我对其工作原理的解释:

If a is true, it checks b. Then,
    - If b is true, the if loop is reduced to if (c)
    - If b is false, the if loop is reduced to if (d)
If a is false, the if loop is reduced to if (false)
Run Code Online (Sandbox Code Playgroud)

我的理解是否正确?
使用这个更好还是多个if/ else支票?

c++ ternary

3
推荐指数
2
解决办法
7847
查看次数

标签 统计

android ×3

button ×1

c++ ×1

eclipse ×1

ternary ×1