思想动态怎么写想思想动态怎么写想思想动态怎么写写思想动态怎么写写思想动态怎么写写。

2271人阅读
不提倡这么写法,可以结合Tab来写,然后每个Activity对应一个Tab选项,这样代码冗余性比较小(博客会在稍后更新到),下面仅做参考&
网上找了半天也没找到如何运用ViewStub写出一个选项卡,而且关于ViewStub也都是基本介绍(基础知识请参照网上,一大坨的转载).之前看到一个老兄写的模拟iphone选项卡的界面,但是那个太麻烦了,本人天生懒惰,没办法只好自己动手写一个了。
先睹为快,看下面截图(有点类QQ通讯录),最底下是一个类似于Tab的选项卡(有点iphone选项卡感觉吧)。&&
为了简单起见,这里就不用这个截图做例子了,下面就用写一个最简单的Demo。
第一步:还是先建立底部的选项卡(其实就是一个TableLayout布局),代码如下(main.xml):
&?xml version=&1.0& encoding=&utf-8&?&
&RelativeLayout
xmlns:android=&/apk/res/android&
android:layout_width=&wrap_content&
android:layout_height=&wrap_content&
android:background=&#ffffff&&
&TableLayout android:layout_width=&fill_parent&
android:layout_height=&54dip&
android:orientation=&horizontal&
android:layout_gravity=&bottom&
android:layout_alignParentBottom=&true&
xmlns:android=&/apk/res/android&
android:layout_width=&fill_parent&
android:layout_height=&54dip&
android:id=&@+id/btn1&
android:background=&#888888&
android:layout_width=&70dip&
android:layout_height=&54dip&
android:layout_weight=&1&
android:text=&Button 1&
android:id=&@+id/btn2&
android:background=&#888888&
android:layout_width=&70dip&
android:layout_height=&54dip&
android:layout_weight=&1&
android:text=&Button 2&
android:background=&#888888&
android:id=&@+id/btn3&
android:layout_width=&70dip&
android:layout_height=&54dip&
android:layout_weight=&1&
android:text=&Button 3&
android:background=&#888888&
android:id=&@+id/btn4&
android:layout_width=&70dip&
android:layout_height=&54dip&
android:layout_weight=&1&
android:text=&Button 4&
&/TableRow&
&/TableLayout&
&/RelativeLayout&
第二步:就是建立4个xml布局文件,里面可以只写一个TextView,命名为btn1_layout.xml,btn2_layout.xml,btn3_layout.xml,btn4_layout.xml.类似如下:
&?xml version=&1.0& encoding=&utf-8&?&
&LinearLayout
xmlns:android=&/apk/res/android&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:text=&Button 1&
android:textSize=&36sp&
android:textColor=&#4a9ad8&
&/LinearLayout&
&将下列代码插入到第一步中main.xml中,位于TableLayout之上
android:id=&@+id/btn1ViewStub&
android:layout=&@layout/btn1_layout&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:id=&@+id/btn2ViewStub&
android:layout=&@layout/btn2_layout&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:id=&@+id/btn3ViewStub&
android:layout=&@layout/btn3_layout&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:id=&@+id/btn4ViewStub&
android:layout=&@layout/btn4_layout&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
&第四步:Activity中,产生点击事件后,首先要将所有的ViewStub设置成不可见,否则将会出问题(你可以试试),java代码如下,具体就不解释了,能用ViewStub相信能看懂。
package com.tab.
import android.app.A
import android.graphics.C
import android.os.B
import android.view.V
import android.view.ViewS
import android.widget.B
public class MainActivity extends Activity {
private ViewStub[] viewStub = new ViewStub[4];
private Button currentB
private Button lastB
private int[] tabBtnIds = {R.id.btn1, R.id.btn2,
R.id.btn3, R.id.btn4};
private Button[] tabBtn = new Button[4];
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
viewStub[0] = (ViewStub) findViewById(R.id.btn1ViewStub);
viewStub[1] = (ViewStub) findViewById(R.id.btn2ViewStub);
viewStub[2] =(ViewStub) findViewById(R.id.btn3ViewStub);
viewStub[3] = (ViewStub) findViewById(R.id.btn4ViewStub);
currentBtn = (Button) findViewById(R.id.btn2);
TabBtnClickListener tabBtnListener = new TabBtnClickListener();
for(int i=0; i&tabBtnIds. i++) {
tabBtn[i] = (Button) findViewById(tabBtnIds[i]);
tabBtn[i].setOnClickListener(tabBtnListener);
class TabBtnClickListener implements View.OnClickListener {
public void onClick(View v) {
lastBtn = currentB
currentBtn = (Button)
if(currentBtn.getId() == lastBtn.getId()) {
currentBtn.setBackgroundColor(Color.BLUE);
lastBtn.setBackgroundColor(Color.GRAY);
int currentIndex = -1;
switch(currentBtn.getId()) {
case R.id.btn1:
currentIndex = 0;
case R.id.btn2:
currentIndex = 1;
case R.id.btn3:
currentIndex = 2;
case R.id.btn4:
currentIndex = 3;
for(int i=0; i&viewStub. i++) {
viewStub[i].setVisibility(View.INVISIBLE);
for(int i=0; i&viewStub. i++) {
if(currentIndex == -1) {
if(currentIndex != i) {
viewStub[i].setVisibility(View.INVISIBLE);
viewStub[i].setVisibility(View.VISIBLE);
最后截个图,比上面那个通讯录难看,但是Activity基本上是一样的。
源码地址:
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:226623次
积分:3051
积分:3051
排名:第5233名
原创:67篇
转载:26篇
评论:155条
(3)(2)(1)(2)(1)(1)(1)(4)(1)(2)(1)(1)(4)(3)(1)(1)(2)(2)(7)(6)(6)(21)(6)(1)(1)(2)(2)(2)(1)(2)(1)(1)(1)BETTER-要想学翻译应该怎么学习?写给想做翻译的新手
1.要想学翻译应该怎么学习?
1.1翻译理论要不要看?
事实上,要想学好翻译,对于一个没有基本翻译理论的人来说,建议还是学一下翻译理论,因为那上面会讲被动变主动,词性的转换啦等,而这对于一个非英语专业的人来说,是有必要的。也是一条捷径,否则很多人则是一个字一翻,不是翻译意思了。比如有人翻译的good
good study, day day up。这样的书一般城市的书店都有的。
当然,也有牛人,英语水平很好,看了英语就能翻译出贴切的汉语,或反之,那就没有必要这么做了。
1.2翻译怎么提高?
历史上的大翻译家,比我们条件要差得多,但是学得成就不比我们差,因为人家有好的方法,那就是吃透一本书,翻译好它。建议新手可以拿来这样的一本书,一页页地看,一点点地翻,翻译了比较,比较了记住,这样才有提高。
就像做飞行员一样,只有飞行了多少个小时之后,才能真正开客机,要不你会开掉下来。口译听力也是如此,一般交替传译要精听150-200盘磁带,而同传则是2000盘才能做起来。注意,这里是精听,泛听不包括在内的。想想吧,一个人要听2000盘磁带是什么概念?翻译也是如此,一般能达到翻译技能的水平,要翻译3-5万字的量;要达到技巧的水平,要翻译的量达到10-15万的量,问问你翻译了多少?
1.3 语法要不要学?
我认为一个好翻译,没有语法观念是不行的,因为翻译出来的句子要是不合语法规则,老外看了就会觉得你的水平不好,起码觉得你有问题。因为说起来,英语是语法呈显性的语言(这里指的汉译英)。
2. 翻译证书要不要考?
还是考下证书为好,因为有了证书,你的砸门砖才有了,否则,一般不易入行。因为你没有东西证明你有这个水平。做笔译的可以考考国家二级笔译。口译的也可以国家人事部的二级口译。
注意:如果你想做好,二级口译或笔译只是你的一个上进的过程中的路标,不是终点。
3. 有了证书是不是能做翻译了?
回答是:It depends!
有了证书,没有实战经验,你就是新人,你得像海绵一样到处去学习。比如你可以结交翻译人员,请他们介绍经验。再就是利用网络,去学习。一次我翻译到专利的汉译英,没有英语的范本怎么办?去网上找!
4. 刚开始能不能做自由人翻译?
刚开始,除非你是自己专业水平高,英语又好,那自然好。可是如果不是,还是到翻译公司做做,因为那里有规范的培训,等自己水平高了,再去做自由人。一个有三年以上翻译经验的人很难找的,找到了年薪就不会低。现在你是用自己的便宜身价换经验,以后是以经验换大洋。付出去的东西,总会有收回来的时候,等式左右应该是相等的。
5.. 什么最重要?
个人体会就是be open!
向任何人学习,在任何地方学习。这么多的论坛,这么多的牛人,为什么不学呢。学翻译就得是杂家,你学的英语,但你得知道碳酸氢钠怎么说,汽车发动机冲程是怎么回事。你要是懒人,没有一颗好奇心,那最好别做翻译。
6. 词汇量重要么?
重要,没有词汇,那你的翻译就是不行。因为词汇量代表一个人的思维能力,British Prime Minister, Winston
Churchill,有90,000词汇量,相当高了,因为比较起来,莎士比亚才16,000,狄更斯才50,000,一个英语专业八级的学生,是13,000,而一个受过良好教育的英美国人,词汇量为25,000。
但是词汇是要积累的,很难想象一个只有5000词汇的人能翻译好东西,因为找不到可以用来表达你想表达意思的词。尤其是做口译的,没有一定的词汇是不行的。要见一词就有想记住它的欲望。
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。我想写腐文,但又不知道要怎么写 求大神帮我吧! 怎么写开头 怎么写他们开始了xxx 怎么写黄..._百度知道
我想写腐文,但又不知道要怎么写 求大神帮我吧! 怎么写开头 怎么写他们开始了xxx 怎么写黄...
提问者采纳
可以去爱所以存在吧学习~里面很多大神写的腐文
提问者评价
其他类似问题
为您推荐:
其他1条回答
子!,要纯洁!
你要写哪方面的?如果是男男。。。我建议你去“快新吧”,“黑新吧”看看,但要做好心理准备啊!(我三观就是被腐女给毁的!)
我没兴趣!!!
我没兴趣!!!
您可能关注的推广
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁大雁我想对你说 300字 怎么写怎么写怎么写_百度知道
大雁我想对你说 300字 怎么写怎么写怎么写
群大雁往南飞,一会就飞远了,一会排成人字,一会排成一字,看不到了……祝你好运
其他类似问题
为您推荐:
我想对你说的相关知识
其他1条回答
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁}

我要回帖

更多关于 设计思想怎么写 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信