首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >我怎样才能在Android上形成一个网络视图呢?

我怎样才能在Android上形成一个网络视图呢?
EN

Stack Overflow用户
提问于 2014-02-19 07:53:58
回答 2查看 99关注 0票数 1

我想在不干扰我的背景图像的情况下填充我的文本视图,但是当我在相对布局上做填充时,它会从四面八方对我的背景进行裁剪,而且当我尝试从文本视图填充我的文本时,它会对我的文本进行填充。

这是我的密码

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".TesbihMainActivity" >

    <ImageView
        android:id="@+id/backroundimage"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:scaleType="centerCrop"
        android:src="@drawable/tesbihbackround"
         />

    <TextView

        android:id="@+id/display"
        android:layout_width="fill_parent"
        android:layout_height="63dp"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:background="#e9ebec"
        android:text=" 385 "
        android:gravity="center"
        android:textSize="52dp"
        android:textColor="#3c677b"
        android:textAppearance="?android:attr/textAppearanceLarge" />

</RelativeLayout>
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-02-19 07:59:57

您可以在您的textView上使用textView而不是android:padding=""。这将在TextView中为textView的所有方向(上、下、左和右)插入一个边距。

如果希望应用特定的页边距,也可以使用这些内容:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
android:layout_marginLeft=""
android:layout_marginTop=""
android:layout_marginRight=""
android:layout_marginBottom=""
票数 1
EN

Stack Overflow用户

发布于 2014-02-19 07:57:18

在TextView上使用页边距,而不是填充。

填充在视图中添加空间。边距增加了外部空间!

例如: TextView上的填充会将TextView的内容从TextView的边框移开。TextView的保证金将使整个TextView远离其母公司的边界。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21885623

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文