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

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

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

問(wèn)題描述

SDK 18 有問(wèn)題.我的文本視圖的重力不能垂直工作.但它適用于 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 上,但邊距不適用.目前我將項(xiàng)目留給 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.

推薦答案

問(wèn)題是 RelativLayout 作為 listview 項(xiàng)的根布局.如果您在 RelativeLayout 周?chē)胖靡粋€(gè) LinearLayout,它也適用于 targetSdk = 19.GridView 也會(huì)出現(xiàn)同樣的問(wèn)題.

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>

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

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

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

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

相關(guān)文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周?chē)h(huán)繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動(dòng)生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數(shù)據(jù)庫(kù))
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對(duì)象?)
Use threading to process file chunk by chunk(使用線(xiàn)程逐塊處理文件)
主站蜘蛛池模板: 正在播放国产精品 | 久久久精品网 | 一级毛片免费视频 | h漫在线观看 | 色欧美片视频在线观看 | 亚洲精品乱码久久久久久久久久 | 综合久久综合久久 | 在线中文字幕国产 | 久久久精品网站 | 久久久久久国产免费视网址 | 国产精品欧美精品日韩精品 | 视频一二三区 | 日韩免费在线视频 | 欧美精品第三页 | 中文字幕免费观看 | 四虎在线视频 | 亚洲 91 | 91成人免费看片 | 成人久草 | 日韩欧美视频免费在线观看 | 综合久久综合久久 | 欧美中文字幕一区二区三区亚洲 | 一级片免费观看 | 亚洲国产精品一区 | 欧美一区二区黄 | 亚洲午夜精品视频 | 国产精品中文字幕在线 | 色爱综合网 | 一呦二呦三呦国产精品 | 国产福利资源 | 97色在线视频 | 国产午夜精品一区二区三区 | 国产成人免费一区二区60岁 | 日韩精品一区二区三区免费视频 | 91精品国产综合久久精品 | 免费黄篇| www久久久 | 毛片网络| caoporn国产精品免费公开 | 成人av免费 | 国产清纯白嫩初高生视频在线观看 |