【问题标题】:android custom title not filling parent widthwise [duplicate]android自定义标题不填充父宽度[重复]
【发布时间】:2011-12-04 07:04:19
【问题描述】:

我已经自定义了我的标题栏。 问题是虽然我提到宽度为 fill_parent 它没有填充父级 两边都有一些空格

代码如下

<resources>
    <style name="LargeTitleTheme">
        <item name="android:windowTitleSize">40dip</item>
    </style>
</resources>

xml2:

<RelativeLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content">
        <TextView android:id="@+id/textview" android:textStyle="bold"
            android:layout_width="fill_parent" android:layout_height="wrap_content"
            android:gravity="center" android:text="fggffgjjkki"
            android:textSize="30sp"
                        android:textColor="#FFFFFF" android:background="@drawable/top_bar" />
</RelativeLayout>

代码:

requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        setContentView(R.layout.homegrid);
        getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.customtitle);

【问题讨论】:

    标签: android custom-titlebar


    【解决方案1】:

    尝试将 android:layout_marginLeft="0dp" android:layout_marginRight="0dp" 添加到 RelativeLayout。

    【讨论】:

      猜你喜欢
      • 2015-02-02
      • 1970-01-01
      • 1970-01-01
      • 2021-07-14
      • 1970-01-01
      • 1970-01-01
      • 2011-07-16
      • 1970-01-01
      • 2016-12-26
      相关资源
      最近更新 更多