好久都没写过博客了,现在都不知道从何写起了。
下面就记录一个UI上的小知识点,供以后用。
我们在布局的时候,常常出现在Button或者TextView上显示一个图片加文字,这个时候我们可以自定义组件,达到需要的效果,当然最简单的方式就是使用自带的属性了。下面是对Button、EditText、TextView的小Demo。
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_launcher"
android:drawablePadding="50dp"
android:gravity="left"
android:text="aaaaaaaaaaaaaaa"
/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_launcher"
android:hint="bbbbbbbbb"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_launcher"
android:text="cccccccccccc"
/>
其中drawableLeft就是文字左边的图片,同理还有drawableTop drawableBottom drawableRight;
drawablePadding是文字与图片的距离。
就先写这些了!!!
分享到:
相关推荐
《AndroidUI基础教程》是一本Android用户界面设计的基础入门图书。全书从最基础的技术概念开始介绍,深入讨论了UI设计的各项技术,涵盖了为应用程序创建UI的所有内容。本书不仅会告诉读者创建灵活布局的最佳方法,...
Android UI开发专题 Android UI开发专题(一) 之界面设计 近期很多网友对Android用户界面的设计表示很感兴趣,对于Android UI开发自绘控件和游戏制作而言掌握好绘图基础是必不可少的。本次专题分10节来讲述,有关...
《Android UI设计》面向创建移动应用的产品经理、设计师和开发者,系统讲解了从事Android UI设计必须要掌握的Android平台的主要技术和特性,全面总结了Android UI的设计原理、设计理念和设计模式,并通过一个综合的...
Android UI控件组件库集合【源码】 热门标签,流式布局,刮刮乐控件,侧滑控件,循环幻灯片控件,自动换行控件,下拉列表,圆角进度控件等常用UI控件组件合集
Android UI 界面设计 移动APP
Android UI设计技巧 Android UI设计技巧Android UI设计技巧
android UI 生成器 可以生成android的UI减轻工作,比eclipse内置的好多了,直接生成布局文件拉人项目直接使用
Android UI设计心得。包括线性布局(LinearLayout)、相对布局(RelativeLayout)、表格布局(TableLayout)、框架布局(FrameLayout)、绝对布局(AbsoluteLayout)。其中AbsoluteLayout在Android SDK2.3.3之后已经...
android UI界面开发图片,数量巨大,而且经典,觉得值得收藏 android UI界面开发图片,数量巨大,而且经典,觉得值得收藏
ANDROID UI设计工具,方便ANDROID UI设计
android UI 特效集合
精通ANDROID UI设计
android UI开发推荐颜色 android UI开发推荐颜色 android UI开发推荐颜色
我之前修改android系统UI收集的一些资料。 android UI定制的一些资料 。
androidUI设计器 自动生成.xml文件,很方便!
androidUI设计实践,你懂的。一般
资源名称:精彩绝伦的Android UI设计:响应式用户界面与设计模式资源截图: 资源太大,传百度网盘了,链接在附件中,有需要的同学自取。
android UI界面设计 初略说了一下UI界面设计基本原理
Android UI开发经典资料,学习设计Android界面的必备资料