首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Textview活动

Textview活动
EN

Stack Overflow用户
提问于 2013-02-14 03:59:31
回答 1查看 467关注 0票数 0

所以基本上我想要显示关于酒店/餐馆/俱乐部/任何东西的信息。我创建了这个布局XML文件:.xml:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >
    <ImageView
        android:id="@+id/picture"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:contentDescription="@string/image"
        android:paddingLeft="10dp"
        android:paddingRight="10dp" />

    <TextView
        android:id="@+id/description"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/picture"
        android:paddingBottom="10dp"
        android:textColor="#000000"
        android:textSize="16sp"
        android:textSTyle="bold" />

    <TextView
        android:id="@+id/description_real"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/description"
        android:paddingLeft="10dp"
        android:textColor="#666666"
        android:textSize="14sp" />

     <TextView
        android:id="@+id/openingtimes"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/description_real"
        android:paddingBottom="10dp"
        android:textColor="#000000"
        android:textSize="16sp"
        android:textSTyle="bold" />

    <TextView
        android:id="@+id/openingtimes_real"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/openingtimes"
        android:paddingLeft="10dp"
        android:textColor="#666666"
        android:textSize="14sp" />
     <TextView
        android:id="@+id/prices"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/openingtimes_real"
        android:paddingBottom="10dp"
        android:textColor="#000000"
        android:textSize="16sp"
        android:textSTyle="bold" />

    <TextView
        android:id="@+id/prices_real"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/prices"
        android:paddingLeft="10dp"
        android:textColor="#666666"
        android:textSize="14sp" />
</RelativeLayout>

我不想收到必须从互联网上显示的文本,但希望在活动本身中定义它。如何创建此活动,以便在XML中定义的布局中显示文本?(非常简单,没有什么是可以点击的,只有文本)

EN

回答 1

Stack Overflow用户

发布于 2013-02-14 05:58:14

看看这篇"Building your First App“教程。这是非常简单和直接的。它具有创建新活动、定义布局和使用资源(如字符串)的所有基础知识。这应该足以实现您所描述的内容。

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

https://stackoverflow.com/questions/14861989

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档