你好,游客 登录 注册 搜索
背景:
阅读新闻

Android应用开发之电子相册

[日期:2012-03-08] 来源:Linux社区  作者:ldj299 [字体:大 中 小]

布局文件如下:

Mail.xml:

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:Android="http://schemas.android.com/apk/res/android"  
  3.     android:orientation="vertical"  
  4.     android:layout_width="fill_parent"  
  5.     android:layout_height="fill_parent"  
  6.     >  
  7. <TextView    
  8.     android:layout_width="fill_parent"   
  9.     android:layout_height="wrap_content"   
  10.     android:text="@string/hello"  
  11.     />  
  12. <Gallery android:id="@+id/gallery"   
  13.     android:layout_width="fill_parent"   
  14.     android:layout_height="wrap_content">  
  15. </Gallery>  
  16.    
  17. <ImageView android:id="@+id/imageView"  
  18.     android:layout_height="fill_parent"  
  19.     android:layout_width="fill_parent">  
  20. </ImageView>  
  21. </LinearLayout>  

下面就是上文中提到的attr.xml:

Attr.xml:

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <resources>  
  3.     <declare-styleable name="Gallery1">  
  4.         <attr name="android:galleryItemBackground" />  
  5.     </declare-styleable>  
  6.      <declare-styleable name="LabelView">  
  7.         <attr name="text" format="string" />  
  8.         <attr name="textColor" format="color" />  
  9.         <attr name="textSize" format="dimension" />  
  10.     </declare-styleable>  
  11. </resources>  

总结:

一个简单的android版电子相册就出来啦,有什么错误的地方还请大家指出来,非常愿意和大家交流Android的知识,本人邮箱在公告里,谢谢!

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款