android - 旋转后 TextView 被剪切

标签 android android-layout rotation textview

我想将 TextView 旋转 90 度。这是有效的,但是,TextView 在 y 轴上被“切割”(即屏幕宽度,请参见屏幕截图)。

我该如何解决这个问题?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center">

    <TextView
        android:rotation="90"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:text="256"
        android:textSize="50mm"
        android:gravity="center"
        android:id="@+id/TextView" />
</LinearLayout>

enter image description here

编辑:

我确定被剪切的是 TextView,而不是我的布局。

最佳答案

尝试将 Textview 中的 android:layout_height 更改为 "wrap_content"

关于android - 旋转后 TextView 被剪切,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28520048/

相关文章:

android - 打开 .xml 文件后 Eclipse 崩溃

android - 使用 onTouchEvent Android 旋转、缩放/缩放、拖动位图

android - 围绕一个圆旋转图像?

android - 通过蓝牙连接多个 Android 虚拟机

android - 将 Android 依赖项添加到 Docker 构建镜像 - Bitbucket Pipelines (CI)

android - 使用 weinre 在 Android 应用程序中调试网页 - 找不到调试目标

java - 使用警报对话框从内部类访问变量

java - EditText View 不在新行上扩展

java - 如何在android中创建android库项目?

javascript - three.js 相机绕 Y 轴的旋转似乎关闭