首页 > 其他 > 详细

自定义样式

时间:2015-02-14 01:11:02      阅读:253      评论:0      收藏:0      [点我收藏+]

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
        style="@style/title"
        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>


自定义样式

原文:http://9882931.blog.51cto.com/9872931/1614385

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!