小编Foa*_*Nik的帖子

滚动停止后,Phonegap onscroll无法正常工作

我正在使用phonegap和jquery mobile开发一个ios应用程序.我的应用程序中有一个列表可以滚动并使用

-webkit-overflow-scrolling: touch; overflow : scroll;
Run Code Online (Sandbox Code Playgroud)

至于滚动感觉像原生.我的问题是滚动停止之前不会触发onscroll事件.只有当您的手指位于屏幕顶部(处于触摸移动状态)时才会触发它,之后在触摸停止之前不会触发.我知道其他一些像iscroll这样的滚动插件,但我不想使用它们,因为它们太多了.我怎样才能解决我的问题?

scroll jquery-mobile cordova

6
推荐指数
1
解决办法
1519
查看次数

android错误:删除片段时"提交已调用"

我想实现一个包含片段的活动!当我点击Fragment1时,会调用Fragment2,当我点击Fragment2时,应该从屏幕上删除Fragment2!我通过在onCreateView中调用Fragment2的LinearLayout的setOnclickListener来实现它,并在我的onclicklistener上调用它

transaction.remove(myFragment);

transaction.commit();

但之后我遇到了这个错误:提交已经调用我如何修复此错误,这是我的代码:这是我的片段类

public class ArticleFragment extends Fragment {
final static String ARG_POSITION = "position";
int mCurrentPosition = -1;
private static LinearLayout l;
private android.support.v4.app.FragmentTransaction transaction;
private Fragment newFragment;

public void setArticleFragment(android.support.v4.app.FragmentTransaction transaction , Fragment newFragment) {
    this.transaction = transaction;
    this.newFragment = newFragment;
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, 
    Bundle savedInstanceState) {
    if (savedInstanceState != null) {
        mCurrentPosition = savedInstanceState.getInt(ARG_POSITION);
    }
    View v = inflater.inflate(R.layout.article_view, container , false);
    l = (LinearLayout) v.findViewById(R.id.transparentArea);
    if(l == null)
    l.setOnClickListener(new OnClickListener() …
Run Code Online (Sandbox Code Playgroud)

android android-fragments android-activity

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

在 Android 上创建后更改小部件设置

我已经用 ConfigurationActivity 构建了一个小部件。一切都很好,但问题是我无法在创建后重新配置它并更改其设置。其他小部件(如天气应用程序或日历应用程序)在您长按它们时会提供一个选项(与“从家里删除”和“应用程序信息”一起),即打开其 ConfigurationActivity 的“小部件设置”。我怎样才能添加这个选项?在下面的屏幕截图中,我的应用程序中缺少“小部件设置”选项。

在此输入图像描述

android widget android-widget

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