【问题标题】:how to set the color of the TextView structure?如何设置 TextView 结构的颜色?
【发布时间】:2012-01-13 21:11:55
【问题描述】:

是否有任何可能的方法来设置 TextView 周围的边框,如下图所示? 第一张是我目前得到的,第二张是我想要的边框。 LinearLayout 中包含的所有元素都只是单独的文本视图 非常感谢您的帮助~~

【问题讨论】:

    标签: android textview


    【解决方案1】:

    您可以通过将 TextView 背景设置为具有如下背景和边框的 xml 形状来做到这一点:

    <shape android:shape="rectangle" xmlns:android="http://schemas.android.com/apk/res/android">
            <solid android:color="#191919" />
            <stroke android:width="1dp" android:color="#191919"/>
      </shape>
    

    您可以对此here进行更多关注

    【讨论】:

      【解决方案2】:

      我认为您可以这样做,请查看以下链接:Android - Way to appear bordered text on the TextView? 这可能有助于解决您的问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-04-09
        • 1970-01-01
        • 1970-01-01
        • 2017-01-12
        • 1970-01-01
        • 2011-03-18
        • 1970-01-01
        • 2012-09-13
        相关资源
        最近更新 更多