当前位置: 编程技术>移动开发
本页文章导读:
▪UIActivityIndicatorView居间 UIActivityIndicatorView居中
activityIndicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
activityIndicator.frame = CGRectMake(0.0, 0.0, 30.0, 30.0);
//activityIndicator.center = self.view.c.........
▪ List中加下加HeaderView和FootView List中加上加HeaderView和FootView
package wyf.ytl;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import android.app.ListActivity;
import android.os.Bundle;
import .........
▪ 转来的,可以见见 转来的,可以看看
浮躁的人容易说:XX语言不行了,应该学YY;——是你自己不行了吧!?
浮躁的人容易问:我到底该学什么;——别问,学就对了;
浮躁的人容易问:XX有钱途吗;——.........
[1]UIActivityIndicatorView居间
来源: 互联网 发布时间: 2014-02-18
UIActivityIndicatorView居中
activityIndicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; activityIndicator.frame = CGRectMake(0.0, 0.0, 30.0, 30.0); //activityIndicator.center = self.view.center; activityIndicator.center = CGPointMake(160.0f, 208.0f); [self.view addSubview: activityIndicator];
[2] List中加下加HeaderView和FootView
来源: 互联网 发布时间: 2014-02-18
List中加上加HeaderView和FootView
package wyf.ytl; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import android.app.ListActivity; import android.os.Bundle; import android.os.Handler; import android.os.SystemClock; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.TextView; public class Sample_8_3 extends ListActivity { private static String[] items = { "lorem", "pellentesque", "augue", "purus" }; private long startTime = SystemClock.uptimeMillis(); private Handler handler = new Handler(); private AtomicBoolean areWeDeadYet = new AtomicBoolean(false); @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); getListView().addHeaderView(buildHeader()); getListView().addFooterView(buildFooter()); setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, items)); } @Override public void onDestroy() { super.onDestroy(); areWeDeadYet.set(true); } private View buildHeader() { Button btn = new Button(this); btn.setText("Randomize!"); btn.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { List<String> list = Arrays.asList(items); Collections.shuffle(list); setListAdapter(new ArrayAdapter<String>(Sample_8_3.this, android.R.layout.simple_list_item_1, list)); } }); return (btn); } private View buildFooter() { TextView txt = new TextView(this); updateFooter(txt); return (txt); } private void updateFooter(final TextView txt) { long runtime = (SystemClock.uptimeMillis() - startTime) / 1000; txt.setText(String.valueOf(runtime) + " seconds since activity launched"); if (!areWeDeadYet.get()) { handler.postDelayed(new Runnable() { public void run() { updateFooter(txt); } }, 1000); } } }
xml
<?xml version="1.0" encoding="utf-8"?> <ListView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawSelectorOnTop="false" />
android:drawSelectorOnTop="false" 那个黄色背景在下面
转http://wang-peng1.iteye.com/blog/578386
[3] 转来的,可以见见
来源: 互联网 发布时间: 2014-02-18
转来的,可以看看
浮躁的人容易说:XX语言不行了,应该学YY;——是你自己不行了吧!?
浮躁的人容易问:我到底该学什么;——别问,学就对了;
浮躁的人容易问:XX有钱途吗;——建议你去抢银行;
浮躁的人容易说:我要中文版!我英文不行!——不行?学呀!
浮躁的人容易问:XX和YY哪个好;——告诉你吧,都好——只要你学就行;
浮躁的人分两种:a)只观望而不学的人;b)只学而不坚持的人;
把时髦的技术挂在嘴边,还不如把过时的技术记在心里;
最新技术文章: