<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:gravity="center">
android:id="@+id/root">
<!-- 关机滑块 -->
<FrameLayout
android:id="@+id/slide_layout"
android:layout_marginTop="50dip"
android:layout_marginLeft="30dip"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<FrameLayout
android:id="@+id/gradientView_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.android.server.policy.GradientPowerView
android:id="@+id/gradientView"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="75dip"
android:layout_centerVertical="true"
android:text="@string/slide_to_poweroff"
android:textSize="16sp"
android:textColor="#505050"
android:SlideColor="#FFFFFF"
/>
</FrameLayout>
</FrameLayout>
上面这段 xml中添加的元素
添加方法
1.添加整个xml的名字到public.xml里声明 ,id 根据最末一个值的id号增加 eg:
<public type="layout" name="iphone_shutdown_dialog" id="0x01090018" />
2.这个xml里的子layout布局需要添加到symbols.xml里声明 eg:<java-symbol type="id" name="gradientView_layout" />
3.自定义的id需要到 public.xml中声明 eg:
<public type="id" name="gradientView" id="0x0102003d" />
4.string资源文件的添加 需要到./frameworks/base/core/res/res/values/trings.xml 根据国际化选择不同的value目录
5.图片资源的添加 需要将图片资源名字在public.xml里声明eg:
<public type="drawable" name="slide_touch_icon" />