※ 引述《fake01 (假面超人)》之铭言:
: 大家好
: 小弟最近在玩相簿的功能,利用gridview读取imageview
: 那在sdcard中含有照片及影片,都可以显示为bitmap放入imageview
: 但是我想再影片的小图示中(bitmap),加入一个播放的小图示,这样
: 才可以知道那是影片。
: 所以想问如何在imageview 里面放入 icon小图示。
: 如果解释得不清楚,还请提出问题。
: 谢谢大家
: ps . 就是类似这个感觉,
: http://farm8.staticflickr.com/7200/13436886014_b1fa96df68_z.jpg
: 不过他是用整个layout而已
疴... 其实没那么复杂
简单用一个framelayout就解决了啊!
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/cat"
android:scaleType="fitCenter"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/video_play_arrow"
android:layout_gravity="center"
/>
</FrameLayout>
简单放个范例结果
http://ppt.cc/kkoa
把它塞进gridview的baseadapter getview
判断影片 就加载这个layout
播放icon网址
http://ppt.cc/RP76
猫icon网址
http://ppt.cc/h1iJ
这只是个demo 不是真的影片
不过layout这样拉应该没错