当前位置: 编程技术>移动开发
本页文章导读:
▪去掉TabActivity底部默许白线 去掉TabActivity底部默认白线
经过一翻百度,google终于实现了TabActivity设置tab自定义背景颜色,设置tab中标题文字的颜色。并将TabWidget置于底部TabManager:import android.app.TabActivity;
import android.co.........
▪ 搜集的blog地址 收集的blog地址
http://www.cnblogs.com/wwwkhdhttp://www.cocoachina.com/iphonedev/sdk/2009/0612/284.html cocochina全区索引http://www.cnblogs.com/lm3515/archive/2011/4/13.html 多线程相关http://blog.csdn.net/bl1988530/article/detai.........
▪ Activity有关 Activity相关
返回数据到前一个Activityhttp://book.51cto.com/art/200907/140403.htmandroid完全退出程序http://www.2cto.com/kf/201108/99444.html
......
[1]去掉TabActivity底部默许白线
来源: 互联网 发布时间: 2014-02-18
去掉TabActivity底部默认白线
经过一翻百度,google终于实现了TabActivity设置tab自定义背景颜色,设置tab中标题文字的颜色。并将TabWidget置于底部
TabManager:
tab_indicator.xml:
tab_font_selector.xml:
colors.xml:
转自:http://www.cmd100.com/bbs/thread-156307-1-1.html
经过一翻百度,google终于实现了TabActivity设置tab自定义背景颜色,设置tab中标题文字的颜色。并将TabWidget置于底部
TabManager:
import android.app.TabActivity; import android.content.Intent; import android.content.res.ColorStateList; import android.content.res.XmlResourceParser; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.widget.TabHost; import android.widget.TabWidget; import android.widget.TextView; public class TabManager extends TabActivity{ private TabManager th; private TabHost tabHost; private TabWidget tabWidget; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tab_content); th = this; tabHost = (TabHost) findViewById(android.R.id.tabhost); LayoutInflater.from(this).inflate(R.layout.main,tabHost.getTabContentView(),true); tabWidget = tabHost.getTabWidget(); tabHost.addTab(tabHost.newTabSpec("tab1").setIndicator("Tab1",th.getResources().getDrawable(R.drawable.ic_menu_home_tab)) .setContent(new Intent(this, Tab1.class))); tabHost.addTab(tabHost.newTabSpec("tab2").setIndicator("Tab2",th.getResources().getDrawable(R.drawable.ic_menu_camera_tab)) .setContent(new Intent(this, Tab2.class))); tabHost.addTab(tabHost.newTabSpec("tab3").setIndicator("Tab3",th.getResources().getDrawable(R.drawable.ic_menu_search_tab)) .setContent(new Intent(this, Tab3.class))); tabHost.addTab(tabHost.newTabSpec("tab4").setIndicator("Tab4",th.getResources().getDrawable(R.drawable.ic_menu_upload_tab)) .setContent(new Intent(this, Tab4.class))); tabHost.addTab(tabHost.newTabSpec("tab5").setIndicator("Tab5",th.getResources().getDrawable(R.drawable.ic_menu_preferences_tab)) .setContent(new Intent(this, Tab5.class))); tabHost.setCurrentTab(0); for (int i = 0; i < tabWidget.getChildCount(); i++) { /** * 此方法是为了去掉系统默认的色白的底角 */ tabHost.setPadding(tabHost.getPaddingLeft(), tabHost.getPaddingTop(), tabHost.getPaddingRight(), tabHost.getPaddingBottom() - 5); View v = tabWidget.getChildAt(i); //设置tab背景颜色 v.setBackgroundResource(R.drawable.tab_indicator); //设置tab中标题文字的颜色,不然默认为黑色 XmlResourceParser xpp = getResources().getXml(R.color.tab_font_selector); try { ColorStateList csl= ColorStateList.createFromXml(getResources(),xpp); TextView tv = (TextView) tabWidget.getChildAt(i).findViewById(android.R.id.title); tv.setTextColor(csl); } catch (Exception e){ e.printStackTrace(); } } } }
tab_indicator.xml:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Non focused states --> <item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@color/tab_unselected" /> <item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@color/tab_selected" /> <!-- Focused states --> <item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@color/tab_focus" /> <item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@color/tab_focus" /> <!-- Pressed --> <item android:state_pressed="true" android:drawable="@color/tab_press" /> </selector>
tab_font_selector.xml:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- Non focused states --> <item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:color="@color/tab_font_unselected" /> <item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:color="@color/tab_font_selected" /> <!-- Focused states --> <item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:color="@color/tab_font_focus" /> <item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:color="@color/tab_font_focus" /> <!-- Pressed --> <item android:state_pressed="true" android:color="@color/tab_font_press" /> </selector>
colors.xml:
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="tab_unselected">#ff000000</color> <color name="tab_selected">#ff383838</color> <color name="tab_focus">#ffff8000</color> <color name="tab_press">#ffe9a700</color> <color name="tab_font_unselected">#ff888888</color> <color name="tab_font_selected">#ffffffff</color> <color name="tab_font_focus">#ffffffff</color> <color name="tab_font_press">#ff888888</color> <color name="black">#FF000000</color> <color name="dkgray">#FF444444</color> <color name="gray">#FF888888</color> <color name="ltgray">#FFCCCCCC</color> <color name="white">#FFFFFFFF</color> <color name="red">#FFFF0000</color> <color name="green">#FF00FF00</color> <color name="blue">#FF0000FF</color> <color name="yellow">#FFFFFF00</color> <color name="cyan">#FF00FFFF</color> <color name="magenta">#FFFF00FF</color> <color name="transparent">#00000000</color> </resources>
转自:http://www.cmd100.com/bbs/thread-156307-1-1.html
[2] 搜集的blog地址
来源: 互联网 发布时间: 2014-02-18
收集的blog地址
http://www.cnblogs.com/wwwkhd
http://www.cocoachina.com/iphonedev/sdk/2009/0612/284.html cocochina全区索引
http://www.cnblogs.com/lm3515/archive/2011/4/13.html 多线程相关
http://blog.csdn.net/bl1988530/article/details/6462496 地图
http://blog.csdn.net/bl1988530/article/details/6719266 iphone支持添加表情
http://blog.csdn.net/bl1988530/article/details/6717240 设计师必须的工具
http://www.cocoanetics.com/2011/01/befriending-core-text/ 图文排版
http://www.minroad.com/ 个人开发者 高伟
https://github.com/qdvictory/WBShareKit 支持新浪 腾讯 豆瓣说分享
http://www.minroad.com/?p=351 oAuth简介
http://www.cocoachina.com/bbs/read.php?tid-75699-fpage-2.html coverFlow原理解析
http://marshal.easymorse.com/ 吴逸秋博客
http://www.cocoachina.com/iphonedev/sdk/2011/1028/3435.html IAP程序内购买
http://www.cocoachina.com/iphonedev/sdk/2011/1102/3443.html icould原理
http://www.cocoachina.com/iphonedev/sdk/2011/1031/3437.html 程序内画地图
http://rainbird.blog.51cto.com/211214/695979 ios5相关问题
http://www.2cto.com/kf/201111/109785.html 正则表达式
http://blog.csdn.net/kmyhy/article/details/7031340 ftp上传东西到app目录下
//开源框架
扫描wifi信息:
http://code.google.com/p/uwecaugmentedrealityproject/
http://code.google.com/p/iphone-wireless/
条形码扫描:
http://zbar.sourceforge.net/iphone/sdkdoc/install.html
tcp/ip的通讯协议:
http://code.google.com/p/cocoaasyncsocket/
voip/sip:
http://code.google.com/p/siphon/
http://code.google.com/p/asterisk-voicemail-for-iphone/
http://code.google.com/p/voiphone/
three20
https://github.com/facebook/three20
google gdata
http://code.google.com/p/gdata-objectivec-client/
720全景显示panoramagl
http://code.google.com/p/panoramagl/
jabber client
http://code.google.com/p/ichabber/
PLBlocks
http://code.google.com/p/plblocks/
image processing
http://code.google.com/p/simple-iphone-image-processing/
json编码解码:http://code.google.com/p/json-framework
base64编码解码:http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/Foundation/?r=87
xml解析:https://github.com/schwa/TouchXML
安全保存用户密码到keychain中:https://github.com/ldandersen/scifihifi-iphone
加载等待特效框架(private api):https://github.com/jdg/MBProgressHUD
http等相关协议封装:http://allseeing-i.com/ASIHTTPRequest
下拉刷新代码:https://github.com/enormego/EGOTableViewPullRefresh
异步加载图片并缓存代码:http://www.markj.net/iphone-asynchronous-table-image/
iphone TTS:https://bitbucket.org/sfoster/iphone-tts
iphone cook book 源码:https://github.com/erica/iphone-3.0-cookbook-
iphone正则表达式:http://regexkit.sourceforge.net/RegexKitLite/
OAuth认证: http://code.google.com/p/oauth/
http://code.google.com/p/oauthconsumer/
蓝牙协议栈:http://code.google.com/p/btstack/
语音识别:http://www.politepix.com/openears/
ShareKit:http://www.getsharekit.com/install/
日历控件:http://code.google.com/p/iphonecal/
https://github.com/klazuka/Kal
zlib, openssl:http://code.google.com/p/ios-static-libraries/
地球显示信息:http://code.google.com/p/whirlyglobe/
http://www.cnblogs.com/wwwkhd
http://www.cocoachina.com/iphonedev/sdk/2009/0612/284.html cocochina全区索引
http://www.cnblogs.com/lm3515/archive/2011/4/13.html 多线程相关
http://blog.csdn.net/bl1988530/article/details/6462496 地图
http://blog.csdn.net/bl1988530/article/details/6719266 iphone支持添加表情
http://blog.csdn.net/bl1988530/article/details/6717240 设计师必须的工具
http://www.cocoanetics.com/2011/01/befriending-core-text/ 图文排版
http://www.minroad.com/ 个人开发者 高伟
https://github.com/qdvictory/WBShareKit 支持新浪 腾讯 豆瓣说分享
http://www.minroad.com/?p=351 oAuth简介
http://www.cocoachina.com/bbs/read.php?tid-75699-fpage-2.html coverFlow原理解析
http://marshal.easymorse.com/ 吴逸秋博客
http://www.cocoachina.com/iphonedev/sdk/2011/1028/3435.html IAP程序内购买
http://www.cocoachina.com/iphonedev/sdk/2011/1102/3443.html icould原理
http://www.cocoachina.com/iphonedev/sdk/2011/1031/3437.html 程序内画地图
http://rainbird.blog.51cto.com/211214/695979 ios5相关问题
http://www.2cto.com/kf/201111/109785.html 正则表达式
http://blog.csdn.net/kmyhy/article/details/7031340 ftp上传东西到app目录下
//开源框架
扫描wifi信息:
http://code.google.com/p/uwecaugmentedrealityproject/
http://code.google.com/p/iphone-wireless/
条形码扫描:
http://zbar.sourceforge.net/iphone/sdkdoc/install.html
tcp/ip的通讯协议:
http://code.google.com/p/cocoaasyncsocket/
voip/sip:
http://code.google.com/p/siphon/
http://code.google.com/p/asterisk-voicemail-for-iphone/
http://code.google.com/p/voiphone/
three20
https://github.com/facebook/three20
google gdata
http://code.google.com/p/gdata-objectivec-client/
720全景显示panoramagl
http://code.google.com/p/panoramagl/
jabber client
http://code.google.com/p/ichabber/
PLBlocks
http://code.google.com/p/plblocks/
image processing
http://code.google.com/p/simple-iphone-image-processing/
json编码解码:http://code.google.com/p/json-framework
base64编码解码:http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/Foundation/?r=87
xml解析:https://github.com/schwa/TouchXML
安全保存用户密码到keychain中:https://github.com/ldandersen/scifihifi-iphone
加载等待特效框架(private api):https://github.com/jdg/MBProgressHUD
http等相关协议封装:http://allseeing-i.com/ASIHTTPRequest
下拉刷新代码:https://github.com/enormego/EGOTableViewPullRefresh
异步加载图片并缓存代码:http://www.markj.net/iphone-asynchronous-table-image/
iphone TTS:https://bitbucket.org/sfoster/iphone-tts
iphone cook book 源码:https://github.com/erica/iphone-3.0-cookbook-
iphone正则表达式:http://regexkit.sourceforge.net/RegexKitLite/
OAuth认证: http://code.google.com/p/oauth/
http://code.google.com/p/oauthconsumer/
蓝牙协议栈:http://code.google.com/p/btstack/
语音识别:http://www.politepix.com/openears/
ShareKit:http://www.getsharekit.com/install/
日历控件:http://code.google.com/p/iphonecal/
https://github.com/klazuka/Kal
zlib, openssl:http://code.google.com/p/ios-static-libraries/
地球显示信息:http://code.google.com/p/whirlyglobe/
[3] Activity有关
来源: 互联网 发布时间: 2014-02-18
Activity相关
返回数据到前一个Activity
http://book.51cto.com/art/200907/140403.htm
android完全退出程序
http://www.2cto.com/kf/201108/99444.html
返回数据到前一个Activity
http://book.51cto.com/art/200907/140403.htm
android完全退出程序
http://www.2cto.com/kf/201108/99444.html
最新技术文章: