自定义样式

发布时间:2020-07-06 00:29:40 作者:InProvence
来源:网络 阅读:209

XML布局

<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:orientation="vertical"
 >

    <TextView
       
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/title" />

  <TextView
      android:layout_width="fill_parent"
      android:layout_height="0dip"
      android:layout_weight="1"
      
      />
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <Button
            android:id="@+id/button1"
              android:background="@drawable/r1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="18sp"
            android:text="@string/up" />

        <Button
            android:layout_alignParentRight="true"
            android:id="@+id/button2"
            android:background="@drawable/btn_bg"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="18sp"
            android:text="@string/down" />

    </RelativeLayout>
</LinearLayout>

style样式

<style   name="title">    
        <item   name="android:background">#6666ff00</item>
        <item   name="android:padding">10dip</item>
        <item   name="android:textSize">20sp</item>
        <item   name="android:gravity">center</item>      
    </style>


推荐阅读:
  1. Android RatingBar 自定义样式
  2. HTML5如何实现自定义样式与日历校验功能

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

自定义样式

上一篇:求较大整数n的阶乘,因为n较大时,n的阶乘超出了正常类型的表示范围,可以采用数组进行操作(c实现)

下一篇:vSphere 部署VDP的OVF模板备份虚拟机

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》