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

莆田做鞋有没有网站看做类似美团的网站吗

莆田做鞋有没有网站看,做类似美团的网站吗,如何规范网站使用,餐饮品牌设计公司哪家好layout#xff08;布局#xff09;定义了用户界面的可视化结构#xff08;visual structure#xff09;,如Activity的UI,应用窗口的UI。 有两种方式声明layout: 1.在xml文件中声明UI组件。 2.在运行时#xff0c;实例化布局元素。我们可以以编码的方式创建View或ViewGroup… layout布局定义了用户界面的可视化结构visual structure,如Activity的UI,应用窗口的UI。       有两种方式声明layout:       1.在xml文件中声明UI组件。       2.在运行时实例化布局元素。我们可以以编码的方式创建View或ViewGroup对象操纵它们的属性。      下面用一个小例子来学习怎样以编码的方式添加layout      1 import android.app.Activity;2 import android.graphics.Color;3 import android.os.Bundle;4 import android.view.ViewGroup;5 import android.widget.Button;6 import android.widget.LinearLayout;7 import android.widget.TextView;8 9 public class MainActivity extends Activity { 10 11 private LinearLayout linearLayout; 12 private TextView textView; 13 private Button button; 14 public static final int VERTICAL 1; 15 public static final int MATCH_PARENT -1; 16 public static final int WRAP_CONTENT -2; 17 Override 18 protected void onCreate(Bundle savedInstanceState) { 19 super.onCreate(savedInstanceState); 20 21 //以编码的方式添加layout 22 23 linearLayout new LinearLayout(this); 24 linearLayout.setOrientation(VERTICAL); //设置LinearLayout方向0是水平1是垂直。默认是水平。 25 //设置布局参数-1是MATCH_PARENT,-2是WRAP_CONTENT 26 //ViewGroup.LayoutParams(int width, int height) 27 linearLayout.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT,MATCH_PARENT)); 28 29 textView new TextView(this); 30 textView.setText(ThisIsATextView); 31 textView.setBackgroundColor(Color.RED); 32 textView.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT,WRAP_CONTENT)); 33 34 button new Button(this); 35 button.setText(ThisIsAButton); 36 button.setBackgroundColor(Color.GREEN); 37 button.setLayoutParams(new ViewGroup.LayoutParams(MATCH_PARENT,WRAP_CONTENT)); 38 39 linearLayout.addView(button); 40 linearLayout.addView(textView); 41 //布局写好后不要忘记添加到Activity中 42 setContentView(linearLayout); 43 44 45 } 46 }       运行效果图                     每个layout文件必须包含一个确定的根元素这个根元素它必须是View或ViewGroup的对象。      那View类和ViewGroup类的作用是什么呢 View:         为用户界面组件提供基本的搭建区域 。View类是widgets的父类widgets通常用来创建交互UI组件         如button,TextView等等。View类同时也是ViewGroup类的父类。 ViewGroup:         是layout类的父类而layout类是保存其他View或ViewGroup的可视化容器(invisible containers),并且能定义它们的布局属性。           通过添加额外的布局对象layout object或窗口(widgets)作为子元素来逐渐完善视图层。             下面通过一个layout文件来具体学习以下      1 !-- 确定的根元素 LinearLayout是ViewGroup的子类layout的对象 --2 LinearLayout xmlns:androidhttp://schemas.android.com/apk/res/android3 xmlns:toolshttp://schemas.android.com/tools4 android:layout_widthmatch_parent5 android:layout_heightwrap_content6 android:orientationvertical 7 !-- 添加子组件来丰富视图层 --8 Button9 android:layout_widthmatch_parent 10 android:layout_heightwrap_content 11 android:background#f00 12 android:layout_weight1 13 android:textThisIsAButton / 14 TextView 15 android:layout_widthmatch_parent 16 android:layout_heightwrap_content 17 android:background#0f0 18 android:textThisIsATextView 19 / 20 /LinearLayout    我们在xml文件中声明好界面的布局方式以后将xml文件保存在res/layout/ 下即可。         希望这篇文章对大家的学习有所帮助如果你喜欢请推荐一下谢谢~       如果转载请在文章开头处注明本博客地址:http:www.cnblogs.com/JohnTsai       欢迎讨论交流邮箱:JohnTsai.Workgmail.com
http://www.huolong8.cn/news/162818/

相关文章:

  • 网站公司怎么做运营广东seo排名
  • dede 百度网站地图wordpress4.7中文主题
  • 四川建设厅官方网站是多少南京网站定制公司
  • 转包网站建设做非法事情极速微网站建设cms
  • 仙桃网站建设中国建设银行网站怎么登录不上去
  • 在凡科上做的网站无法加载出来网站建设网站设计哪家专业
  • 哈尔滨寸金网站建设价钱夸克建站系统官网
  • 沭阳网站建设招聘光明区住房和建设局网站
  • 手机网站视频无法播放是怎么回事简洁手机购物网站会员中心模板
  • 国内设计网站推荐建电子商务网站费用
  • 网站建设和管理是教什么科目服装鞋帽商城网站建设
  • 博物馆 网站 建设cn后缀做网站
  • 天河区营销型网站建设wordpress企业站爱主题
  • 美食网站建设毕业设计wordpress后台编辑主题时提示:抱歉_该文件无法被编辑
  • 做配电柜在哪个网站发布信息自己建网站卖东西怎么样
  • 企业备案 网站服务内容赣州人才网下载
  • 网站建设怎样创建链接网站页面优化简单吗
  • 网站制作公司的宣传海报松滋网站设计
  • 具备网站维护与建设能力新郑市建设局网站
  • 如何查看网站的更新频率专做影视评论的网站
  • 杭州做商务网站浙江省工程建设管理协会网站
  • 网站建设空间主机的选择公众号运营
  • 做网站需要什么硬件环境wordpress播放本地mp3
  • wordpress中文企业主题下载亚马逊seo推广
  • 个人做外贸商城网站北京开发app
  • 微信公众号网站建设游戏高端网站开发环境
  • 所得税汇算清缴在哪个网站做北京住房投资建设中心网站首页
  • 快速建网站软件什么是平台内部营销
  • 营销型网站和普通网站的区别自己建设的网站有管理后台的登录
  • 附近的网站建设公司洛阳尚贤网络科技有限公司