当前位置: 编程技术>移动开发
本页文章导读:
▪用 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!
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.
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);
}
}
});
}
}
<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);
}
}
});
}
}
最新技术文章: