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

石家庄制作网站公司有哪些网站如何改首页模块

石家庄制作网站公司有哪些,网站如何改首页模块,网业浏览设置在哪,陕西省住房和建设厅官方网站1、如何在一个按钮上放上一张图片#xff1f;把按钮和图片套在一个FrameLayout中 !-- 必须将button和ImageView分别嵌套在两个LinearLayout中才能 实现将图片放在按钮上 -- FrameLayout android:orientationhorizontal android:layout_width把按钮和图片套在一个FrameLayout中 !-- 必须将button和ImageView分别嵌套在两个LinearLayout中才能 实现将图片放在按钮上 --   FrameLayout    android:orientationhorizontal    android:layout_widthwrap_content    android:layout_heightwrap_content    LinearLayout     android:layout_widthwrap_content     android:layout_heightwrap_content     Button      stylestyle/menu_btn_style      android:idid/fan_us      android:textstring/mainmenu_facebook_fan_us /    /LinearLayout    LinearLayout     android:layout_widthwrap_content     android:layout_heightwrap_content     ImageView      android:layout_widthwrap_content      android:layout_heightwrap_content      android:layout_marginLeft16dp      android:layout_marginTop13dp      android:srcdrawable/facebookicon /    /LinearLayout   /FrameLayout         2、如何自定义组件自定义一个下划线形式的输入框 第一确定要画多少条下划线第二每条线的宽度第三下划线的间距 1自定义文本输入框package com.heima.guesswho.util; import com.heima.android.guesswho.R; import android.content.Context;import android.content.res.TypedArray;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android.util.AttributeSet;import android.widget.EditText; public class DashlineEditText extends EditText { /*  * 假设下划线总长100个单位要画7条下划线每条下划线间距为2个单位  * 具体算法如下  * 每条下划线的长度(1002)/7-2  * for(int i 0;i7,i){  *     第i条线  *   x1 ((1002)/7)*i  *   y1 getHeight()  *   x2 ((1002)/7)*i(1002)/7-2  *   y2 getHeight()  * }  *   */  private Paint linePaint new Paint(); private  int segmentCount 8;//总共画8条分割线可以作为默认值 private  int distance 5;//每个分割线的间距为4个单位可以作为默认值  /*  * 从布局文件中得到对应属性的值  */ public DashlineEditText(Context context, AttributeSet attrs) {  super(context, attrs);  setBackgroundDrawable(null);//消除文本框效果的作用  //linePaint.setColor(Color.RED);//设置画笔的颜色    TypedArray array context.obtainStyledAttributes(attrs, R.styleable.DashLineET);  segmentCount array.getInt(R.styleable.DashLineET_segment_count, segmentCount);//从指定属性中拿到对应的值若没设置则用默认值  distance array.getInt(R.styleable.DashLineET_distance, distance);  int color array.getInt(R.styleable.DashLineET_dashline_color, Color.RED);  linePaint.setColor(color); }  Override protected void onDraw(Canvas canvas) {  super.onDraw(canvas);  int width getWidth();//自定义控件的宽度  int height getHeight()-3;//必须减去数才能显示出下划线    //画出每一条下划线  for(int i 0; i segmentCount; i){   int oneSegmentWidth (widthdistance)/segmentCount - distance;//每条下划线的长度   int startX (segmentCountdistance)*i ;//每条下划线的起点位置   int stopX startXoneSegmentWidth ;//每条下划线的终点位置   canvas.drawLine(startX, height, stopX, height, linePaint);  }   }} 2布局文件?xml version1.0 encodingutf-8?LinearLayout xmlns:androidhttp://schemas.android.com/apk/res/android android:orientationvertical android:layout_widthfill_parent android:layout_heightfill_parent TextView  android:layout_widthfill_parent  android:layout_heightwrap_content  android:textstring/debug_name /  com.heima.guesswho.util.DashlineEditText  android:layout_width100dp  android:layout_height12dp  android:texttest //LinearLayout 定义自定义组件的属性 第一步在string.xml文件中配置declare-styleable    !-- 定义DashLineEditText的属性 -- declare-styleable  nameDashLineET  attr   namesegments_cnt   formatinteger /  attr   namedistance   formatdimension /  attr   namedashline_color   formatcolor /  attr   namehint_msg   formatreference /  attr   namehint_color   formatcolor / /declare-styleable 第二步在自定义组件中复写构造方法用来获取布局文件中属性的值   /*  * 从布局文件中得到对应属性的值  */ public DashlineEditText(Context context, AttributeSet attrs) {  super(context, attrs);  setBackgroundDrawable(null);//消除文本框效果的作用  //linePaint.setColor(Color.RED);//设置画笔的颜色    TypedArray array context.obtainStyledAttributes(attrs, R.styleable.DashLineET);  segmentCount array.getInt(R.styleable.DashLineET_segment_count, segmentCount);//从指定属性中拿到对应的值若没设置则用默认值  distance array.getInt(R.styleable.DashLineET_distance, distance);  int color array.getInt(R.styleable.DashLineET_dashline_color, Color.RED);  linePaint.setColor(color); }   第三步在使用自定义组件的布局文件中加入命名空间 如xmlns:heimahttp://schemas.android.com/apk/res/com.heima.android.guesswho heima 为我们使用属性时使用的前缀相当于使用Android属性时要使用android前缀一样其中com.heima.android.guesswho为清单文件标识应用的包名 布局文件如下 ?xml version1.0 encodingutf-8?LinearLayout xmlns:androidhttp://schemas.android.com/apk/res/android xmlns:heimahttp://schemas.android.com/apk/res/com.heima.android.guesswho android:orientationvertical android:layout_widthfill_parent android:layout_heightfill_parent TextView  android:layout_widthfill_parent  android:layout_heightwrap_content  android:textstring/debug_name /  com.heima.guesswho.util.DashlineEditText  android:layout_width100dp  android:layout_height12dp  heima:segment_count10  heima:distance3  android:texttest //LinearLayout    com.heima.guesswho.util.DashlineEditText    android:layout_width210dip   heima:segment_count9    heima:distance4dip    heima:dashline_colorcolor/font_white    android:layout_heightwrap_content    android:textColor#FF0000    android:hintstring/input_name_prompt    android:text /转载于:https://www.cnblogs.com/csj007523/archive/2011/07/04/2097510.html
http://www.sadfv.cn/news/336755/

相关文章:

  • 徐州商城网站建设高端网站价格
  • aspcms分类信息网站wordpress functions.php在哪里
  • 心理医院网站优化服务商网站收录了但是搜索不到
  • 网站建设淄博太原适合网站设计地址
  • 天津企悦在线网站建设学ui wordpress模板
  • WordPress电影公司网站卖一手房做哪个网站好
  • 随身wifi网站设置货源网站程序
  • 网站建设什么行业域名访问网址
  • 有多少网站可以推广业务中山做营销型网站公司
  • 做高仿网站在线课堂网站开发
  • 网站开发的后台开发工具餐饮商城网站建设
  • 网站建设商标保护安徽安搜做的网站怎么样
  • 网站地址跟网页地址区别php在wordpress
  • 上海网站原型设计网页设计主要做什么
  • 响应式网站建设一般多少钱宁津华企动力做网站的电话多少
  • 义乌网站建设软件商城官网
  • 云存储做网站自媒体app推广
  • 网站建设销售合同萝岗企业网站建设
  • 保险网站建设方案wordpress添加百度统计
  • 玉溪市住房城乡建设局网站二手手表回收网站
  • 做内容网站赚钱吗如何快速开发一个网站
  • 网站建设题库及答案房地产最新消息政策代表了什么
  • 爱网站在线观看视频c#网站开发工具
  • 灯具设计网站推荐县电子政务办网站建设工作思路
  • 长春做网站团队餐饮网站模板
  • 设计网站外网网站后台样式
  • ajax网站开发典型实例网站跳出率的衡量标准
  • html5做手机网站59网站一起做网店女鞋
  • 珍岛网站建设信息流广告是什么意思?
  • 企业网站优化兴田德润优惠专门做外贸的网站有哪些