【问题标题】:custom title bar linked with mutiple activites与多个活动链接的自定义标题栏
【发布时间】:2012-03-28 18:34:48
【问题描述】:

大家好,我为我的应用制作了自定义标题栏。我想知道这是否只是标题栏的代码不多。我问的原因是我想要一个小组活动,但我不喜欢 tab-host,因为我尝试过但我不喜欢它。所以我喜欢标题栏而不是标签主机

      <?xml version="1.0" encoding="utf-8"?>
      <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/pt5"
      android:orientation="vertical" >

<FrameLayout
    android:id="@+id/frameLayout1"
    android:layout_width="match_parent"
    android:layout_height="50dp" >

    <RelativeLayout
        android:id="@+id/relativeLayout1"
        android:layout_width="match_parent"
        android:layout_height="match_parent" android:background="@drawable/tilte2">

        <Button
            android:id="@+id/button1"
            android:layout_width="108dp"
            android:layout_height="fill_parent"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true"
            android:background="@null" android:drawableBottom="@drawable/info_btn"/>

        <Button
            android:id="@+id/button3"
            android:layout_width="105dp"
            android:layout_height="fill_parent"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:background="@null" android:drawableBottom="@drawable/car_key"/>

        <Button
            android:id="@+id/button2"
            android:layout_width="105dp"
            android:layout_height="fill_parent"
            android:layout_alignParentTop="true"
            android:layout_toRightOf="@+id/button3"
            android:background="@null" />
    </RelativeLayout>
</FrameLayout>

谢谢你

【问题讨论】:

    标签: android custom-titlebar


    【解决方案1】:

    TabActivity 是 Android 的有用功能之一。如果您不想使用它并且想要制作自定义标签栏,那么您可以创建一个抽象活动并在其中创建一个标签栏,然后之后,在您想使用标签栏的任何活动中,您都可以扩展该抽象类。

    这里是link,您可以将其作为标签栏的一个选项。

    【讨论】:

    • 我知道我做了什么。但我确实喜欢这个广播组的样子,谢谢 dharmendra
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多