-6
A
回答
3
你正在努力寻找晶圆厂 in fab,fab1 in fab1 ... 您需要从Fragment的根视图中获取这些按钮。
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.carte_reseaux_fragment, container, false);
fab = (FloatingActionButton) rootView.findViewById(R.id.fab);
.
.
Animation fab_open = AnimationUtils.loadAnimation(getContext(), R.anim.fab_open);
//Actually FloatingActionButton has own implementation
fab.setShowAnimation(fab_open);
return rootView;
}
+0
谢谢你,它适用于fab,fab1,fab2但不适用于fab_open,fab_close ... –
+0
这些是动画而非视图元素。所以看起来你的实现对于动画初始化是正确的。你只需要绑定动画来查看元素并开始。 – zgr
+0
谢谢:),而不是getContext()你应该把getActivity(),我试过了,它的工作原理 –
相关问题
- 1. NullPointerException异常和NoSuchElementException异常
- 2. System.console()NullPointerException异常
- 3. OnListItemClick NullPointerException异常
- 4. openRawResource NullPointerException异常
- 5. Observable.notifyObservers NullPointerException异常
- 6. drawBitmap NullPointerException异常
- 7. getTermFreqVector() - NullPointerException异常
- 8. NullPointerException异常
- 9. NullPointerException异常
- 10. AndroidViewClient - NullPointerException异常
- 11. 的NullPointerException异常
- 12. GLSurfaceView NullPointerException异常
- 13. NullPointerException异常
- 14. Color.ParseColor() - NullPointerException异常
- 15. ViewSwitcher NullPointerException异常
- 16. NullPointerException异常findViewById()
- 17. NullPointerException异常
- 18. Files.isDirectory NullPointerException异常
- 19. schemagen NullPointerException异常
- 20. Date.getMillisOf NullPointerException异常
- 21. 为NullPointerException异常
- 22. ArrayAdapter.getCount()NullPointerException异常
- 23. robotium NullPointerException异常
- 24. NullPointerException异常
- 25. notifyDataSetChanged()NullPointerException异常
- 26. getSupportActionBar()NullPointerException异常
- 27. NullPointerException异常:FragmentManager.beginTransaction()
- 28. NullPointerException异常SQLiteAssetHelper
- 29. NullPointerException异常
- 30. setTypeface NullPointerException异常
而不是把图像的,你应该粘贴代码在这里 – tumisma
复制粘贴错误和代码。不要张贴截图。 – Rohit5k2
您需要了解关于布局的基本知识以及如何充气。只要搜索一下你会得到有用的内容 – kishorepatel