久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Android sdk 18 TextView 重力不能垂直工作

Android sdk 18 TextView gravity doesn#39;t work vertically(Android sdk 18 TextView 重力不能垂直工作)
本文介紹了Android sdk 18 TextView 重力不能垂直工作的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

SDK 18 有問題.我的文本視圖的重力不能垂直工作.但它適用于 sdk17.

I have a probleme with the SDK 18. The gravity of my text view doesn't work vertically. But it's working with sdk17.

圖片和代碼:

header_of_listView.xml:

header_of_listView.xml :

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/RelativeLayout1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal" >

        <ImageView
            android:id="@+id/iv_bg"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/entete.size.h"
            android:layout_alignParentLeft="true"
            android:layout_alignParentRight="true"
            android:layout_centerHorizontal="true"
            android:contentDescription="@string/blank"
            android:scaleType="fitXY"
            android:src="@drawable/cellule_flecher_mise_en_valeur" />

        <TextView
            android:id="@+id/tv_message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@id/iv_bg"
            android:layout_alignLeft="@id/iv_bg"
            android:layout_alignRight="@id/iv_bg"
            android:layout_alignTop="@id/iv_bg"
            android:layout_marginBottom="6dp"
            android:gravity="center"
            android:text="@string/a_remplacer"
            android:textColor="@color/tableviewText"
            android:textSize="18sp"
            android:textStyle="bold" 
            android:layout_centerHorizontal="true"/>

    </RelativeLayout>

AndroidManifest.xml

AndroidManifest.xml

<uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

AndroidManifest.xml

AndroidManifest.xml

<uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

textview 為黑色背景android:background="#000000"

with black background for textview android:background="#000000"

如果有人有想法.我嘗試用 match_parent 更改 wrap_content.

If someone have an idea. I have try to change wrap_content with match_parent.

唯一有效的是android:layout_height="@dimen/entete.size.h" 在 TextView 上,但邊距不適用.目前我將項目留給 SDK 17.

The only thing that work is android:layout_height="@dimen/entete.size.h" on the TextView, but the margin doesn't apply. For the moment I leave the project to SDK 17.

推薦答案

問題是 RelativLayout 作為 listview 項的根布局.如果您在 RelativeLayout 周圍放置一個 LinearLayout,它也適用于 targetSdk = 19.GridView 也會出現同樣的問題.

The problem is the RelativLayout as root layout of the listview item. If your put a LinearLayout around the RelativeLayout it works also with targetSdk = 19. Same problem appears with the GridView.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="match_parent">

   ... your layout like before

</LinearLayout>

這不是一個很好的解決方法 - 但我猜比將 targetSdk = 17 更好.

This is not really a nice workaround - but better than put targetSdk = 17 I guess.

這篇關于Android sdk 18 TextView 重力不能垂直工作的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數據庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 国内自拍视频在线观看 | 久草青青草 | 欧美激情99 | 日本不卡在线视频 | 亚洲午夜av久久乱码 | 亚洲永久精品国产 | 69av网| 欧美日韩在线免费 | 一级片毛片 | 亚洲欧美成人影院 | 国产一级电影在线观看 | 黄色综合| 国产精品久久久久久久久久免费看 | 国产精品不卡一区 | 欧美二区在线 | 欧美一区二区免费 | 中文字幕一区在线观看视频 | 午夜网 | 中国一级大毛片 | 亚洲一区二区三区免费视频 | 亚洲大片在线观看 | 99re热这里只有精品视频 | 在线观看国产网站 | 美女国产| 国产99久久精品一区二区300 | 精品视频一区二区三区 | 97人人超碰 | 欧美激情综合五月色丁香小说 | 黄色av观看 | 日韩一区二区三区视频在线播放 | 99视频在线免费观看 | 成人三区| 欧美视频免费在线 | 视频第一区 | 久久久精品在线 | 九九热在线精品视频 | 日日操夜夜操天天操 | 欧美国产精品一区二区 | 欧美日韩高清在线观看 | 亚洲视频国产视频 | 日韩国产一区二区三区 |