当前位置:  编程技术>移动开发
本页文章导读:
    ▪用 lipo 下令裁剪出需要的 architecture        用 lipo 命令裁剪出需要的 architecture     iOS 上的 framework 和 .a 库一般会同时支持多个 architecture, 比如 i386, armv7, armv7s 等。    为了减小程序的尺寸,可能需要裁剪掉不需要的 architecture, 这时.........
    ▪ hidesBottomBarWhenPushed处置方案        hidesBottomBarWhenPushed处理方案 1down voteNot sure if a solution was found for this but I just managed to get this working.My scenario:I have a UITabBarController with 4 tab bar items. On one of the tab bar items it loads a UIViewController with .........
    ▪ HorizontalScrollView 水准动态生成TextView       HorizontalScrollView 水平动态生成TextView <HorizontalScrollView        android:id="@+id/hs_tab"        android:layout_width="fill_parent"        android:layout_height="50dp"        android:background="@color/wh.........

[1]用 lipo 下令裁剪出需要的 architecture
    来源: 互联网  发布时间: 2014-02-18
用 lipo 命令裁剪出需要的 architecture
    iOS 上的 framework 和 .a 库一般会同时支持多个 architecture, 比如 i386, armv7, armv7s 等。
    为了减小程序的尺寸,可能需要裁剪掉不需要的 architecture, 这时就需要使用 lipo 命令给程序瘦身。
     Step1: 查看目标库文件支持的 architecture, 两个选择
                1.1 lipo -info 目标库文件
                 1.2 file 目标库文件
    Step2: 生成只支持一个 architecture 的 库文件
                 lipo 目标库文件 -thin 目标architecture 目标文件名
                 eg:    lipo MVC -thin i386 MVC.i386
                 eg1:    lipo MVC -thin armv7 MVC.armv7

       最后,删掉旧的库文件,把目标库文件改成原来的名字,进行替换即可。

     YEAH!

    
[2] hidesBottomBarWhenPushed处置方案
    来源: 互联网  发布时间: 2014-02-18
hidesBottomBarWhenPushed处理方案

1
down vote
Not sure if a solution was found for this but I just managed to get this working.

My scenario:

I have a UITabBarController with 4 tab bar items. On one of the tab bar items it loads a UIViewController with buttons on it. The buttons calls a IBOutlet function that loads another UIViewController which contains the a tab bar at the bottom.

After many trial & error........

On the IBOutlet function, I do the following:

{
self.hidesBottomBarWhenPushed = YES;
/* Push the new controller with tab bar */
}
This was working fine with the UITabBarController's tab bar sliding to the left and my tab bar from the pushed controller sliding from the right.

Obviously from functionality perspective I need to push the initial UITabBarController's tar bar back in when "going back".

After many trial & error........

I have the method viewWillDisappear in the UIViewController that pushes the UIViewController with tab bar as:

- (void) viewWillDisappear:(BOOL)animated
{
    self.hidesBottomBarWhenPushed = NO;
}
I ran a few quick tests on this in the simulator and it seems to work fine.

Some contributors suggests that this is bad UI but I am trying this out at the moment to see how it works out.

Happy to receive (cop) any feedbacks.

    
[3] HorizontalScrollView 水准动态生成TextView
    来源: 互联网  发布时间: 2014-02-18
HorizontalScrollView 水平动态生成TextView
<HorizontalScrollView
        android:id="@+id/hs_tab"
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:background="@color/white"
        android:layout_below="@id/activity_bbs_topc_list_top"
        android:scrollbars="none" >
       
        <LinearLayout
            android:id="@+id/ll_scrollview"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            >
           
        </LinearLayout>
       
    </HorizontalScrollView>








private void addBootypeTextView(final List<Ptype> result) {
for (int i = 0; i < result.size(); i++) {
final int index = i;
Ptype ptype = result.get(index);

layout = (LinearLayout) findViewById(R.id.ll_scrollview);

TextView tv = new TextView(mContext);

LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
lp.leftMargin = 10;
lp.rightMargin = 10;
lp.topMargin = 15;
tv.setLayoutParams(lp);
if (i == 0) {
tv.setBackgroundResource(R.drawable.selected);
tv.setTextColor(Color.rgb(255, 255, 255));
} else {
tv.setTextColor(Color.GRAY);
}
tv.setPadding(new DPIUtil().dip2px(mContext, 10.0f),
new DPIUtil().dip2px(mContext, 5.0f),
new DPIUtil().dip2px(mContext, 10.0f),
new DPIUtil().dip2px(mContext, 5.0f));
tv.setTextSize(16);
tv.setGravity(Gravity.CENTER);
tv.setText(ptype.getName());
layout.addView(tv);

tv.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
setViewByForeach();

v.setBackgroundResource(R.drawable.selected);
TextView textView = (TextView) v;
textView.setTextColor(Color.rgb(255, 255, 255));
typeId = result.get(index).getId();
topicList.clear();
refresh();
}

void setViewByForeach() {
int childCount = layout.getChildCount();
for (int j = 0; j < childCount; j++) {
TextView textview = (TextView) layout.getChildAt(j);
textview.setBackgroundColor(-1);
textview.setTextColor(Color.GRAY);
}
}
});
}
}

    
最新技术文章:
▪Android开发之登录验证实例教程
▪Android开发之注册登录方法示例
▪Android获取手机SIM卡运营商信息的方法
▪Android实现将已发送的短信写入短信数据库的...
▪Android发送短信功能代码
▪Android根据电话号码获得联系人头像实例代码
▪Android中GPS定位的用法实例
▪Android实现退出时关闭所有Activity的方法
▪Android实现文件的分割和组装
▪Android录音应用实例教程
▪Android双击返回键退出程序的实现方法
▪Android实现侦听电池状态显示、电量及充电动...
▪Android获取当前已连接的wifi信号强度的方法
▪Android实现动态显示或隐藏密码输入框的内容
▪根据USER-AGENT判断手机类型并跳转到相应的app...
Web服务器/前端 iis7站长之家
▪Android中实现为TextView添加多个可点击的文本
▪Android程序设计之AIDL实例详解
▪Android显式启动与隐式启动Activity的区别介绍
▪Android按钮单击事件的四种常用写法总结
▪Android消息处理机制Looper和Handler详解
▪Android实现Back功能代码片段总结
▪Android实用的代码片段 常用代码总结
▪Android实现弹出键盘的方法
▪Android中通过view方式获取当前Activity的屏幕截...
▪Android提高之自定义Menu(TabMenu)实现方法
▪Android提高之多方向抽屉实现方法
▪Android提高之MediaPlayer播放网络音频的实现方法...
▪Android提高之MediaPlayer播放网络视频的实现方法...
▪Android提高之手游转电视游戏的模拟操控
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3