当前位置: 首页 > news >正文

青海医院网站建设公司网站篡改搜索引擎js

青海医院网站建设公司,网站篡改搜索引擎js,郑州企业网站优化,商城网站都有哪 些功能查了好多资料#xff0c;发现还是不全#xff0c;干脆自己整理吧#xff0c;至少保证在我的做法正确的#xff0c;以免误导读者#xff0c;也是给自己做个记录吧#xff01; 首先先看一个小例子#xff0c;接着讲授理原 TabTest.java view plaincopy to clipboardpr…查了好多资料发现还是不全干脆自己整理吧至少保证在我的做法正确的以免误导读者也是给自己做个记录吧      首先先看一个小例子接着讲授理原             TabTest.java     view plaincopy to clipboardprint?   package org.hualang.tab;     import android.app.Activity;     import android.app.TabActivity;     import android.graphics.Color;     import android.os.Bundle;     import android.widget.TabHost;     import android.widget.Toast;     import android.widget.TabHost.OnTabChangeListener;     public class TabTest extends TabActivity {         /** Called when the activity is first created. */         TabHost tabhost;         Override         public void onCreate(Bundle savedInstanceState) {             super.onCreate(savedInstanceState);             setContentView(R.layout.main);             //获得TabHost对象             tabhost  getTabHost();             //为TabHost添加签标             //新建一个newTabSpec(newTabSpec)             //设置其签标和标图setIndicator             //设置容内setContent             tabhost.addTab(tabhost.newTabSpec(tab1)                     .setIndicator(TAB 1,getResources().getDrawable(R.drawable.img1))                     .setContent(R.id.text1));             tabhost.addTab(tabhost.newTabSpec(tab2)                     .setIndicator(TAB 2,getResources().getDrawable(R.drawable.img2))                     .setContent(R.id.text2));             tabhost.addTab(tabhost.newTabSpec(tab3)                     .setIndicator(TAB 3,getResources().getDrawable(R.drawable.img3))                     .setContent(R.id.text3));             //设置TabHost的背景颜色             //tabhost.setBackgroundColor(Color.argb(150,22,70,150));             //设置TabHost的背景图片资源             tabhost.setBackgroundResource(R.drawable.bg0);             //设置前当示显哪个签标             tabhost.setCurrentTab(0);             //签标换切事件处理setOnTabChangedListener             tabhost.setOnTabChangedListener(new OnTabChangeListener()             {                 public void onTabChanged(String tabId)                 {                     Toast toastToast.makeText(getApplicationContext(), 现在是tabId签标, Toast.LENGTH_SHORT);                     toast.show();                 }             });                      }     }              main.xml      ?xml version1.0 encodingutf-8?     TabHost xmlns:androidhttp://schemas.android.com/apk/res/android         android:idandroid:id/tabhost         android:layout_widthfill_parent         android:layout_heightfill_parent         LinearLayout             android:orientationvertical             android:layout_widthfill_parent             android:layout_heightfill_parent             TabWidget                 android:idandroid:id/tabs                 android:layout_widthfill_parent                 android:layout_heightwrap_content /             FrameLayout                 android:idandroid:id/tabcontent                 android:layout_widthfill_parent                 android:layout_heightfill_parent                 TextView                      android:idid/text1                     android:layout_widthfill_parent                     android:layout_heightfill_parent                      android:text选项卡1 /                 TextView                      android:idid/text2                     android:layout_widthfill_parent                     android:layout_heightfill_parent                      android:text选项卡2 /                 TextView                      android:idid/text3                     android:layout_widthfill_parent                     android:layout_heightfill_parent                      android:text选项卡3 /             /FrameLayout         /LinearLayout     /TabHost               Android TabWidget的实现可以分为二种一种是应用准标TabActivity实现另外一种可以自定义方法实现种这方法实现起来对相较比复杂但对于要实现较比多元化的view是很好的这里我们简略看下源码      一、通用做法      继承TabActivity实现自己的TabActivity             [java] view plaincopy import android.app.Activity;   import android.app.TabActivity;   import android.content.Intent;   import android.os.Bundle;   import android.widget.TabHost;   import android.widget.TabHost.OnTabChangeListener;   public class TabWidgetDemo2 extends TabActivity implements OnTabChangeListener {        private TabHost mTabHost;               Override       protected void onCreate(Bundle savedInstanceState) {           // TODO Auto-generated method stub           super.onCreate(savedInstanceState);                      setContentView(R.layout.tabwidgetdemo2);             mTabHost  getTabHost();           mTabHost.setOnTabChangedListener(this);           setupTab1();           setupTab2();           mTabHost.setCurrentTab(1);       }       private void setupTab2() {           // TODO Auto-generated method stub           Intent intent  new Intent();           intent.setAction(Intent.ACTION_MAIN);           intent.setClass(this, TabWidget2.class);           mTabHost.addTab(mTabHost.newTabSpec(TabWidget2)                   .setIndicator(TabWidget2,getResources().getDrawable(R.drawable.icon))                   .setContent(intent));       }       private void setupTab1() {           // TODO Auto-generated method stub           Intent intent  new Intent();           intent.setAction(Intent.ACTION_MAIN);           intent.setClass(this, TabWidget1.class);           mTabHost.addTab(mTabHost.newTabSpec(TabWidget1)                   .setIndicator(TabWidget1,getResources().getDrawable(R.drawable.icon))                   .setContent(intent));       }       public void onTabChanged(String tabId) {           // TODO Auto-generated method stub           Activity activity  getLocalActivityManager().getActivity(tabId);           if (activity ! null) {               activity.onWindowFocusChanged(true);           }       }                   }        二个tab对应的Activity先看TabWidget1这个类在第二种实现中还会用到因此我们可以看到对Action的判断。             [java] view plaincopy import android.app.Activity;   import android.content.Intent;   import android.os.Bundle;   import com.android.exampledemo.R;   import com.android.exampledemo.util.DemoUtils;   public class TabWidget1 extends Activity {       Override       protected void onCreate(Bundle savedInstanceState) {           // TODO Auto-generated method stub           super.onCreate(savedInstanceState);                      Intent intent  this.getIntent();           if (intent.getAction().equals(Intent.ACTION_MAIN)){               setContentView(R.layout.tabwidgetdemo2_1);           }           else {               setContentView(R.layout.tabwidget_1);               DemoUtils.updateButtonBar((Activity)this,R.id.contactstab);           }       }   }               再看一下TabWidget2这个Activity我们在第二种实现方法中也会用到。             [java] view plaincopy import com.android.exampledemo.R;   import com.android.exampledemo.util.DemoUtils;   import android.app.Activity;   import android.content.Intent;   import android.os.Bundle;   public class TabWidget2 extends Activity {       Override       protected void onCreate(Bundle savedInstanceState) {           // TODO Auto-generated method stub           super.onCreate(savedInstanceState);                      Intent intent  this.getIntent();                      if (intent.getAction().equals(Intent.ACTION_MAIN)){               setContentView(R.layout.tabwidgetdemo2_1);           }           else {               setContentView(R.layout.tabwidget_2);               DemoUtils.updateButtonBar((Activity)this,R.id.groupstab);           }       }   }               最后就是各个Activity对应的layout      1.tabwidgetdemo2.xml             [xhtml] view plaincopy ?xml version1.0 encodingutf-8?   TabHost     xmlns:androidhttp://schemas.android.com/apk/res/android     android:idandroid:id/tabhost     android:layout_widthfill_parent     android:layout_heightfill_parent     LinearLayout        android:orientationvertical       android:layout_widthfill_parent       android:layout_heightfill_parent       TabWidget android:idandroid:id/tabs           android:layout_widthfill_parent           android:layout_height68dip           android:paddingLeft1dip           android:paddingRight1dip           android:paddingTop4dip           /       FrameLayout android:idandroid:id/tabcontent           android:layout_widthfill_parent           android:layout_height0dip           android:layout_weight1           /       /LinearLayout    /TabHost        2.二个sub tab对应的layout             [xhtml] view plaincopy Layout1   ?xml version1.0 encodingutf-8?   LinearLayout     xmlns:androidhttp://schemas.android.com/apk/res/android     android:layout_widthfill_parent     android:layout_heightfill_parent     android:background#FFF     TextView android:idid/textview        android:layout_widthwrap_content        android:layout_heightwrap_content       android:textTab Widget first      /TextView   /LinearLayout   Layout2   ?xml version1.0 encodingutf-8?   LinearLayout     xmlns:androidhttp://schemas.android.com/apk/res/android     android:layout_widthfill_parent     android:layout_heightfill_parent     android:background#FFF     TextView android:idid/textview        android:layout_widthwrap_content        android:layout_heightwrap_content       android:textTab Widget second      /TextView   /LinearLayout                      方法2      先创立一个Activity TabWidgetDemo             [c-sharp] view plaincopy 1.TabWidgetDemo.java   import com.android.exampledemo.R;   import com.android.exampledemo.util.DemoUtils;   import android.app.Activity;   import android.content.Context;   import android.content.SharedPreferences;   import android.os.Bundle;   //not use tabhost to organized    public class TabWidgetDemo extends Activity {       Override       protected void onCreate(Bundle savedInstanceState) {           // TODO Auto-generated method stub           super.onCreate(savedInstanceState);           //int activeTab  DemoUtils.getIntPref(this, activetab, R.id.artisttab);           SharedPreferences prefs                getSharedPreferences(getPackageName(), Context.MODE_PRIVATE);           int activeTab  prefs.getInt(activetab, R.id.contactstab);           if (activeTab ! R.id.contactstab                    activeTab ! R.id.groupstab) {               activeTab  R.id.contactstab;           }           DemoUtils.activateTab(this, activeTab);       }   }   2.DemoUtils   import android.app.Activity;   import android.content.Intent;   import android.net.Uri;   import android.view.View;   import android.widget.TabWidget;   import com.android.exampledemo.R;   public class DemoUtils {       static int sActiveTabIndex  -1;              public static void activateTab(Activity a,int active_id){           Intent intent  new Intent(Intent.ACTION_PICK);           switch (active_id) {           case R.id.contactstab:               intent.setDataAndType(Uri.EMPTY, vnd.android.cursor.dir/tb_contacts);               break;           case R.id.groupstab:               intent.setDataAndType(Uri.EMPTY, vnd.android.cursor.dir/tb_groups);               break;           default:               return;           }           intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);           a.startActivity(intent);           a.finish();           a.overridePendingTransition(0,0);       }                     public static void updateButtonBar(Activity a, int highlight) {           final TabWidget ll  (TabWidget) a.findViewById(R.id.buttonbar);                       for (int i  ll.getChildCount() - 1; i  0; i--) {                View v  ll.getChildAt(i);                boolean isActive  (v.getId()  highlight);                if (isActive) {                       ll.setCurrentTab(i);                       sActiveTabIndex  i;                }                                v.setTag(i);                v.setOnClickListener(new View.OnClickListener() {                       public void onClick(View v) {                           int id  v.getId();                           if (id  ll.getChildAt(sActiveTabIndex).getId()) {                               return;                           }                           activateTab((Activity)ll.getContext(),id );                           ll.setCurrentTab((Integer) v.getTag());                       }});            }       }   }                     二个Tab sub activity前一方法中经已给出这里我们只需要看一下layout的实现就能够了      1buttonbar.xml             [xhtml] view plaincopy ?xml version1.0 encodingutf-8?   TabWidget xmlns:androidhttp://schemas.android.com/apk/res/android       android:idid/buttonbar       android:layout_widthmatch_parent       android:layout_heightwrap_content        TextView           android:idid/contactstab           android:focusabletrue           android:drawableTopdrawable/icon           android:backgrounddrawable/buttonbarbackground           android:textContacts           android:textColorcolor/tab_indicator_text           android:textAppearance?android:attr/textAppearanceSmall           android:paddingTop7dip           android:paddingBottom2dip           android:gravitycenter           android:layout_weight1           android:layout_marginLeft-3dip           android:layout_marginRight-3dip           android:layout_widthmatch_parent           android:layout_height84dip           android:singleLinetrue           android:ellipsizemarquee /       TextView           android:idid/groupstab           android:focusabletrue           android:drawableTopdrawable/icon           android:backgrounddrawable/buttonbarbackground           android:textGroup           android:textColorcolor/tab_indicator_text           android:textAppearance?android:attr/textAppearanceSmall           android:paddingTop7dip           android:paddingBottom2dip           android:gravitycenter           android:layout_weight1           android:layout_marginLeft-3dip           android:layout_marginRight-3dip           android:layout_widthmatch_parent           android:layout_height84dip           android:singleLinetrue           android:ellipsizemarquee /   /TabWidget        2tabwidget_1.xml             [xhtml] view plaincopy ?xml version1.0 encodingutf-8?   LinearLayout     xmlns:androidhttp://schemas.android.com/apk/res/android     android:layout_widthfill_parent     android:layout_heightfill_parent          include layoutlayout/battonbar /          ExpandableListView android:idid/android:list                     android:layout_widthfill_parent                      android:layout_heightwrap_content                     android:footerDividersEnabledtrue                     android:fadeScrollbarstrue                     android:drawSelectorOnToptrue     /ExpandableListView        /LinearLayout        3 tabwidget_2.xml             [xhtml] view plaincopy ?xml version1.0 encodingutf-8?   LinearLayout     xmlns:androidhttp://schemas.android.com/apk/res/android     android:layout_widthfill_parent     android:layout_heightfill_parent          include layoutlayout/battonbar /        /LinearLayout          文章结束给大家分享下程序员的一些笑话语录 真正的程序员喜欢兼卖爆米花他们利用CPU散发出的热量做爆米花可以根据米花爆裂的速度听出正在运行什么程序。 转载于:https://www.cnblogs.com/jiangu66/archive/2013/04/14/3020375.html
http://www.pierceye.com/news/817330/

相关文章:

  • 淘宝网站开发成本武进建设局网站进不去
  • 比较好网站制作公司行业协会网站织梦模板
  • 牛人网络网站像wordpress一样的网站吗
  • 那种做任务的网站叫什么wordpress 数据库 旧Ip
  • 制作深圳网站建设百度推广广告收费标准
  • 电影采集网站建设国产做爰全免费的视频网站
  • 集团网站建设特点 助君长春seo公司网站
  • 网站域名备案 更改吗在线做文档的网站
  • 青海网站制作多少钱做网站教程pdf
  • dw做网站背景音乐wordpress 获取当前文章id
  • 上海鹭城建设集团网站icp备案查询
  • 企业站用什么程序做网站深圳手机报价网站
  • 网站开发国外研究状况建设部相关网站
  • 租赁网站开发台州网站优化
  • 网站开发人员工工资网站开发一个支付功能要好多钱
  • 工程建设管理网站源码网站怎样做地理位置定位
  • 太仓公司网站建设电话网络公关名词解释
  • 江门网站建设策划什么是网络营销职能
  • 北京网站托管毕设做网站是不是太low
  • 企业网站建设费用属管理费用吗重庆网站建设制作设计公司哪家好
  • 深圳营销型网站需要多少钱做网站个体户经营范围
  • php 手机网站 上传图片晋州做网站的联系电话
  • 云天下网站建设做抖音seo排名软件是否合法
  • 网站开发合同管辖权异议龙岩网上办事大厅官网
  • 建网站费用明细海口建设网站
  • 网站页面设计说明怎么写影视小程序源码
  • 传媒网站制作网站申请建设
  • 前端做项目的网站新密市城乡建设局网站
  • 网站app建设方案智能外呼系统
  • 创建网站免费注册wordpress 熊掌号代码