小编Aka*_*eet的帖子

在TextView中显示度数符号

我希望在我的活动中显示50度,TextView如下所示

在此输入图像描述

我真的不知道如何做到这一点,通过谷歌搜索我找到了这个XML代码

android:text="50°"
Run Code Online (Sandbox Code Playgroud)

我不知道上面的代码是什么.
任何人都可以向我解释究竟是什么以及它是如何工作的.

xml user-interface android

5
推荐指数
3
解决办法
4075
查看次数

如何在 Android 中为不同的内容使用相同的 Activity?

考虑我正在为我的应用程序使用线性布局

 <TextView
    android:text="product 1"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:textColor="@android:color/white"
    android:textSize="54sp"
    android:background="#009611" />

<TextView
    android:text="product 2"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:textColor="@android:color/white"
    android:textSize="54sp"
    android:background="#123431" />

<TextView
    android:text="product 3"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:textColor="@android:color/white"
    android:textSize="54sp"
    android:background="#009688" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我的输出是:

akash preet 样本输出

当我选择product1它应该打开product1_des Activity
当我选择product2它应该打开product2_des Activity
当我选择product3它应该打开product3_des Activity
然后继续..

我有 1000 个产品,我应该创建 1000 个活动吗?我如何使用product_des活动(即单个活动)来支持我所有的 1000 种产品,这些产品具有与该产品相关的不同描述?请帮我。

user-interface android android-linearlayout

3
推荐指数
1
解决办法
1017
查看次数