作家
登录

Android Coding利器之掌握小技巧,助你Coding更上一层楼~

作者: 来源: 2017-08-02 14:01:30 阅读 我要评论

"1.0" encoding="utf-8"?><LinearLayout 
  •     xmlns:android="http://schemas.android.com/apk/res/android" 
  •     xmlns:tools="http://schemas.android.com/tools" 
  •     android:layout_width="match_parent" 
  •     android:layout_height="match_parent" 
  •     android:background="#FFF" 
  •     android:divider="@drawable/shape_0" 
  •     android:orientation="vertical" 
  •     android:showDividers="middle|beginning|end" 
  •     tools:context="cn.hlq.hlqstudyandroid.MainActivity"
  •  
  •     <TextView 
  •         android:layout_width="match_parent" 
  •         android:layout_height="wrap_content" 
  •         android:drawableLeft="@mipmap/ic_launcher_1" 
  •         android:drawablePadding="10dp" 
  •         android:gravity="center_vertical" 
  •         android:padding="10dp" 
  •         android:text="item项111"/> 
  •  
  •     <TextView 
  •         android:layout_width="match_parent" 
  •         android:layout_height="wrap_content" 
  •         android:drawableLeft="@mipmap/ic_launcher_1" 
  •         android:drawablePadding="10dp" 
  •         android:gravity="center_vertical" 
  •         android:padding="10dp" 
  •         android:text="item项222"/></LinearLayout>  
  • 下面简单介绍下android:showDividers属性:

    android:showDividers="middle|beginning|end":鉴名其意,三个属性值分别为 中心 开端部分 停止部分,也就是在三个部分显示瓜分线。

    六、禁止截屏功能,借居保护App

    想想实现禁止应用截屏,只须要一行代码,如下:

    1. getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE); 

    块,防止异常导致崩溃

    防止setContentView后即可,之落后屏的时刻,会提示以下内容:


      推荐阅读

      球星们要失业?机器人在2050年可以击败专业足球队

    人工智能和机械人成长越来越快,人们也开端担心本身的工作在某一天被机械人代替。别怕,别说一般技能的工作,就是像内马尔如许的大年夜球星,也许很快都邑“掉业”了。近日,Ro>>>详细阅读


    本文标题:Android Coding利器之掌握小技巧,助你Coding更上一层楼~

    地址:http://www.17bianji.com/lsqh/36506.html

    关键词: 探索发现

    乐购科技部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与乐购科技进行文章共享合作。

    网友点评
    自媒体专栏

    评论

    热度

    精彩导读
    栏目ID=71的表不存在(操作类型=0)