jjzjj

SherlockFragment

全部标签

android - 处理 fragment 和查看寻呼机 : can't change tag of fragment AND Recursive entry to executePendingTransactions

首先,我知道这些主题已经在stackoverflow上创建了很多时间,但我还没有找到解决我的问题的方法。其次,我是法国人,所以我的英语并不完美,如果您不明白,请提前告诉我。最后介绍一下,这是我第一次处理fragment,所以,如果有什么我不太了解的地方,请原谅!我有三个按钮,可以在三个fragment之间切换。在其中一个fragment中,我有一个包含两个fragment的View寻呼机。目前,每个fragment(有5个)只包含一个TextView。我正在使用最新版本的android-support-v4(我在stackoverflow中阅读了很多主题,说最新版本的支持解决了我遇到的

android - 启用主页按钮 ActionbarSherlock, Sherlockfragment

我想在我的fragment中启用主页按钮。这个问题之前被问过,但是为了一个Activity。我试过了……getSupportActionBar().setDisplayHomeAsUpEnabled(true);...但这行不通。这是我的代码:importcom.actionbarsherlock.R;importcom.actionbarsherlock.app.ActionBar;importcom.actionbarsherlock.app.ActionBar.Tab;importcom.actionbarsherlock.app.SherlockFragment;importc

android - 如何访问 SherlockFragment 中的共享首选项

我在选项卡中使用sherlockfragment,但我无法访问sharedpreference或保存它,我该怎么办?这是我的代码:publicclassSettingsActivityextendsSherlockFragment{privateCheckBoxcb1;privateContextcontext=getActivity();privateSharedPreferencessp;@OverridepublicViewonCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState

android - 在选项卡内切换 fragment

我正在创建一个使用ActionBarSherlock的应用。该应用程序由三个选项卡组成,在每个选项卡中,多个屏幕根据用户输入连续显示。我可以在选项卡之间切换fragment,但是在选项卡中切换fragment会出现问题。我试过这样:在主类中:SingleStationFragmentsingleStationFragment=newSingleStationFragment();FragmentTransactiontransaction=getSupportFragmentManager().beginTransaction();transaction.replace(android

android - 在选项卡内切换 fragment

我正在创建一个使用ActionBarSherlock的应用。该应用程序由三个选项卡组成,在每个选项卡中,多个屏幕根据用户输入连续显示。我可以在选项卡之间切换fragment,但是在选项卡中切换fragment会出现问题。我试过这样:在主类中:SingleStationFragmentsingleStationFragment=newSingleStationFragment();FragmentTransactiontransaction=getSupportFragmentManager().beginTransaction();transaction.replace(android

android - match_parent 不适用于 SherlockFragment 中 listView 的 layout_height

我想在使用actionbarsherlocklib实现的Navigationdrawer中的fragment中使用listview。问题是listView高度没有缩放到match_parent。它正在扩大到ListView的一项。我搜索了很多,尝试过类似的问题,还尝试将父布局更改为Relative_layout、Linear_layout和Frame_layout。我没有明白我做错了什么。如何缩放我的listView以获得布局的其余大小。这是它在编辑器中的样子这是它在应用程序中的样子。listView的大小缩放到一个项目。对于更多项目,我必须在该空间内滚动。我的主要fragment布局

android - Robolectric:如何测试包含 SherlockFragment 的 Activity ?

我已经从这里、github和robolectric博客阅读了很多链接,但还没有找到可行的解决方案(已经使用Robolectric2.0alpha2)。更新:即使我们将SherlockFragment替换为android.support.v4.app.Fragment也会出现此问题。遵循此tip后,我能够测试SherlockFragmentActivity,但是当我将这个fragment(即SherlockFragment)添加到我的Activityxml时:SherlockFragment类:publicclassExampleFragmentextendsSherlockFragme

android - 如何在 SherlockFragment 中实现 onCreateOptionsMenu 方法?

我真的很难在我的Sherlockfragment中设置onCreateOptionsMenu方法,因为我通常不会那么多地使用Sherlockfragment。有人可以告诉我必须导入什么以及实现是如何工作的吗?我的一些代码:publicclassMyFragmentextendsSherlockFragment{@OverridepublicViewonCreateView(LayoutInflaterinflater,ViewGroupcontainer,BundlesavedInstanceState){ViewrootView=inflater.inflate(R.layout.c