TextView中显示文字和图片
2011-07-20 01:33
501 查看
<TextView android:id="@id/tvReload" android:text="@string/main_reload"
//文字位于图片的下方
android:drawableBottom="@drawable/detail_refresh_icon" style="@style/detail_btn" />
<TextView android:id="@id/tvComment" android:text="@string/comment"
android:drawableBottom="@drawable/detail_comment_icon" style="@style/detail_btn" />
<TextView android:id="@id/tvForward" android:text="@string/forward"
android:drawableBottom="@drawable/detail_forward_icon" style="@style/detail_btn" />
<TextView android:id="@id/tvFav" android:text="@string/itemmenu_bookmark"
android:drawableBottom="@drawable/detail_fav_icon" style="@style/detail_btn" />
<TextView android:id="@id/tvMore" android:text="@string/more"
android:drawableBottom="@drawable/detail_more_icon" style="@style/detail_btn" />
//TextView的Button效果
<style name="detail_btn">
<item name="android:textSize">@dimen/bottom_tab_font_size</item>
<item name="android:textColor">@android:color/black</item>
<item name="android:ellipsize">marquee</item>
<item name="android:gravity">center_horizontal</item>
<item name="android:background">@drawable/detail_btn_bg</item>
<item name="android:paddingTop">8.0dip</item>
<item name="android:paddingBottom">5.0dip</item>
<item name="android:focusable">true</item> //可点击
<item name="android:clickable">true</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:singleLine">true</item>
<item name="android:layout_weight">1.0</item>
</style>
//文字位于图片的下方
android:drawableBottom="@drawable/detail_refresh_icon" style="@style/detail_btn" />
<TextView android:id="@id/tvComment" android:text="@string/comment"
android:drawableBottom="@drawable/detail_comment_icon" style="@style/detail_btn" />
<TextView android:id="@id/tvForward" android:text="@string/forward"
android:drawableBottom="@drawable/detail_forward_icon" style="@style/detail_btn" />
<TextView android:id="@id/tvFav" android:text="@string/itemmenu_bookmark"
android:drawableBottom="@drawable/detail_fav_icon" style="@style/detail_btn" />
<TextView android:id="@id/tvMore" android:text="@string/more"
android:drawableBottom="@drawable/detail_more_icon" style="@style/detail_btn" />
//TextView的Button效果
<style name="detail_btn">
<item name="android:textSize">@dimen/bottom_tab_font_size</item>
<item name="android:textColor">@android:color/black</item>
<item name="android:ellipsize">marquee</item>
<item name="android:gravity">center_horizontal</item>
<item name="android:background">@drawable/detail_btn_bg</item>
<item name="android:paddingTop">8.0dip</item>
<item name="android:paddingBottom">5.0dip</item>
<item name="android:focusable">true</item> //可点击
<item name="android:clickable">true</item>
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:singleLine">true</item>
<item name="android:layout_weight">1.0</item>
</style>
相关文章推荐
- TextView 文字加图片显示效果
- Android textview获取html文字 + 图片显示
- 用9path图片做背景 button和textview的文字不显示
- 安卓TextView显示图片与文字作为底部菜单
- TextView 文字加图片显示效果
- 带行间距的TextView,让文字和ImageSpan中的图片居中显示
- 在TextView中显示Html格式的文字/图片/超链接
- android 文字图片混排,在一个TextView中显示文字穿插图片,文字变色效果
- android textview混合显示图片和文字
- Android自定义TextView实现文字图片居中显示
- TextView设置背景图片为.9.png文字不显示
- Android常用UI编程_TextView显示图片和文字(包含超链接)
- 在TextView中显示文字和图片
- android launcher主菜单显示图片和文字之BubbleTextView
- TextView文本显示图片和文字,竖直滚动显示
- 安卓TextView显示图片与文字作为底部菜单
- Android DrawableTextView图片文字居中显示实例
- TextView中显示不同颜色的文字和图片
- 用9path图片做背景 button和textview的文字不显示
- Android自定义TextView实现文字图片居中显示的方法