【问题标题】:Displaying ImageButtons in an Activity在 Activity 中显示 ImageButton
【发布时间】:2011-03-07 07:05:12
【问题描述】:

我想在我的 android 应用程序的活动中显示 ImageButtons like

现在当我点击任何一个 ImageButton 时,它应该会启动一个新的 Activity。

我不知道这种观点是否可行。 ?

【问题讨论】:

    标签: android android-widget android-layout


    【解决方案1】:

    这对你有帮助,

    http://www.inter-fuser.com/2010/01/android-coverflow-widget.html
    

    还有这个

    http://stackoverflow.com/questions/5116825/android-circular-gallery-or-listview-with-zoom-in-and-out-option/5116945#5116945
    

    【讨论】:

    【解决方案2】:

    您应该检查Gallery 小部件。

    【讨论】:

    【解决方案3】:

    是的,这是可能的。就像一个按钮 clck 监听器一样,还有一个图像按钮的监听器。通过调用另一个活动 a

    【讨论】:

      【解决方案4】:

      你可以试试下面的代码:-

      ImageButton imageButton = new ImageButton(getApplicationContext());
      
          imageButton.setOnClickListener(new OnClickListener() {
      
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
      
                  Intent intent = new Intent("<activity_class_name or intent action");
      
                  context.startActivity(intent);
      
              }
          });
      

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-25
      • 1970-01-01
      • 2018-05-19
      • 2015-12-01
      • 1970-01-01
      相关资源
      最近更新 更多