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

网页无法访问此网站做电商排名网站

网页无法访问此网站,做电商排名网站,简单网站页面设计,建设网站 请示 报告为了能让代码能够更多的复用#xff0c;故使用组合控件。下面是我正在写的项目中用到的方法。 1、先写要组合的一些需要的控件#xff0c;将其封装到一个布局xml布局文件中。 ?xml version1.0 encodingutf-8? RelativeLayout xmlns:an…为了能让代码能够更多的复用故使用组合控件。下面是我正在写的项目中用到的方法。 1、先写要组合的一些需要的控件将其封装到一个布局xml布局文件中。 ?xml version1.0 encodingutf-8? RelativeLayout xmlns:androidhttp://schemas.android.com/apk/res/androidandroid:layout_widthmatch_parentandroid:layout_height68dipandroid:idid/aaaTextViewandroid:idid/tv_update_titleandroid:layout_widthmatch_parentandroid:layout_heightwrap_content android:textSize20spandroid:layout_marginTop10dpandroid:layout_marginLeft10dpandroid:text是否升级 /TextViewandroid:layout_belowid/tv_update_titleandroid:idid/tv_update_contentandroid:textSize15spandroid:layout_widthmatch_parentandroid:layout_heightwrap_content android:layout_marginTop10dpandroid:layout_marginLeft10dpandroid:text停止更新 /CheckBoxandroid:checkedfalseandroid:idid/cb_isupdateandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_alignParentRighttrueandroid:layout_centerVerticaltrue //RelativeLayout 2、自定义Java类 package com.frank.mobilesafe.ui;import com.frank.mobilesafe.R;import android.R.bool; import android.content.Context; import android.util.AttributeSet; import android.util.Log; import android.view.View; import android.widget.CheckBox; import android.widget.RelativeLayout; import android.widget.TextView;public class SettingItemView extends RelativeLayout {private CheckBox cb_update;private TextView tv_update_title;private TextView tv_update_content;public SettingItemView(Context context, AttributeSet attrs, int defStyle) {super(context, attrs, defStyle);initView(context);}private void initView(Context context) {// TODO Auto-generated method stubView.inflate(context, R.layout.setting_item_view, this);cb_update (CheckBox) findViewById(R.id.cb_isupdate);tv_update_title (TextView) findViewById(R.id.tv_update_title);tv_update_content (TextView) findViewById(R.id.tv_update_content);}public SettingItemView(Context context, AttributeSet attrs) {super(context, attrs);initView(context);}public SettingItemView(Context context) {super(context);initView(context);}/*** 检查是否选中* return*/public boolean isChecked() {return cb_update.isChecked();}/*** 设置组合控件的状态* param isChecked*/public void SetChecked(boolean isChecked) {cb_update.setChecked(isChecked);}/*** 设置描述信息* param isChecked*/public void SetDesc(String text) {tv_update_content.setText(text);} } 3、在主界面中引用 ?xml version1.0 encodingutf-8? LinearLayout xmlns:androidhttp://schemas.android.com/apk/res/androidandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroid:orientationvertical TextViewandroid:idid/tv_maintitleandroid:layout_widthmatch_parentandroid:layout_height55dpandroid:background#8866ff00android:gravitycenterandroid:text设置中心android:textSize22sp /com.frank.mobilesafe.ui.SettingItemViewandroid:idid/siv_updateandroid:layout_widthmatch_parentandroid:layout_heightwrap_content/ /LinearLayout 4、主界面调用 public class SettingActivity extends Activity {private SettingItemView siv_update;private SharedPreferences sp_update;Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_setting);siv_update (SettingItemView) findViewById(R.id.siv_update);sp_update getSharedPreferences(config,MODE_PRIVATE);boolean update sp_update.getBoolean(update, false);if (update) {siv_update.SetChecked(true);siv_update.SetDesc(有新版本则更新);}else{siv_update.SetChecked(false);siv_update.SetDesc(停止更新);}siv_update.setOnClickListener(new OnClickListener() {Overridepublic void onClick(View v) {Editor editor sp_update.edit();// TODO Auto-generated method stubif (siv_update.isChecked()) {siv_update.SetChecked(false);siv_update.SetDesc(停止更新);editor.putBoolean(update, false);}else{siv_update.SetChecked(true);siv_update.SetDesc(有新版本则更新);editor.putBoolean(update, true);}}});}} 5、完成 正常显示转载于:https://www.cnblogs.com/xuhongfei/p/4009881.html
http://www.zqtcl.cn/news/480220/

相关文章:

  • 网站小程序怎么做北京单位网站建设培训
  • 北京市专业网站建设广州安全教育平台登录账号登录入口
  • 广州做网站的价格三个关键词介绍自己
  • 基于工作过程的商务网站建设:网页制作扬州网站建设公元国际
  • wordpress著名网站微信公众号怎么做网站链接
  • 长沙网站建设大概多少钱深圳做网站网络营销公司
  • 融资平台排行榜企业网站seo运营
  • 英文手表网站南昌装修网站建设
  • 网站建设要懂哪些技术甘肃园区网络搭建
  • go做的网站微信跳转链接生成器免费
  • 网站开发中怎么设置快捷键怎样打开用sql做的网站
  • 做餐饮企业网站的费用短视频素材免费下载网站
  • 美食优秀设计网站制作网页网站
  • 提供网站建设教学视频做淘宝美工需要知道的网站
  • 百度云可以做网站吗织梦网站下载
  • 有没有一起做游戏棋牌网站的用wordpress做商城
  • 有没有如何做网站的书常州网站推广公司哪家好
  • 金融直播间网站开发专业定制网页设计
  • 装饰公司网站开发c 网站开发实例教程
  • 专业层析成像代做网站网站建设收获
  • saas云建站平台源码附近那里有做网站的
  • 网站开发接口成都学校网站建设
  • 商城网站策划火星建站和八亿建站
  • 如何使用模板做网站php精品网站建设
  • 建设一个网站的具体流程职业培训机构需要什么资质
  • 网站怎么做弹幕播放器自助免费网站制作
  • 网站咨询弹窗是怎么做的网站建设的目标客户
  • 搞好姓氏源流网站建设Wordpress 商城主题过于臃肿
  • 如何网站客户案例上海网站备案查询
  • 沈阳大熊网站建设制作北京门户网站制作公司