解决方案 »
- android通过post传参保存参数值到.net后台数据库怎么实现?
- 为什么要这么设计(看了SimpleExpandableListAdapter.java源代码的疑问)?
- 求助:自己写的安卓音乐播放器在模拟器里能显示mp3内嵌封面,在手机里却什么都不显示。
- layout\main.xml文件用DIY控件报错?
- android使用GoogleMap,如何获取到当前位置或特定位置的经纬度
- 下载文本文件失败,好心人给看下问题出在哪了,谢谢!
- Android系统的平板电脑,他的SDK是什么,怎么建立开发环境?
- 请问下如何区分 sdcard和 u盘
- android如何获取通知栏信息
- 刚刚学android遇到的一个小问题 望大神指教
- Android中调用系统相册后不选图片,直接点击取消崩溃!!!!
- 刮刮乐实例教程
我参照的范例,没有用add方法,但能够正常执行hide和show方法...这是为什么
我大概明白你的意思,但这个payProductFragment是原来就包含在布局文件中,应该不用手动add吧
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/linearLayout"
android:visibility="gone" >
<fragment
android:id="@+id/book_list"
android:name="com.example.book_activity.BookListFragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
/>
</LinearLayout>然后在你的listView点击事件中调用
LinearLayout linearLayout=(LinearLayout)findViewById(R.id.linearLayout);
linearLayout.setVisibility(linearLayout.VERTICAL);
可是这样子太生硬了,用FragmentManager能够设置一些淡入淡出或左近右出这样的效果