我需要2种在Android中显示垂直标签的方法:
我是否需要为这两种情况开发自定义小部件(一种情况),我可以使TextView以这种方式呈现,如果我需要完全自定义,那么这样做的好方法是什么?
假设您有一个普通的TextView,其中写有"Stackoverflow",是否可以将TextView旋转-90°,使底部的S和屏幕顶部的W?当然,我可以把我的文字写成图像,旋转它并以这种方式使用它,但我现在对文本很感兴趣.谢谢.
我试图旋转文本视图,但当我旋转它时,它保持宽度和高度信息
我希望所选区域消失,我只想将文本显示在绿色指示器对中居中.我正在更改java部分中的文本'Small Text',但是当文本的长度发生变化时,对齐变得疯狂(picture3)
这是我的代码我做错了什么?
<ImageView
android:id="@+id/statusIcon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/bulletgreen"
android:layout_marginRight="5dp"
/>
<TextView
android:id="@+id/status"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginLeft="5dp"
android:rotation="-90"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="10sp"
android:textStyle="bold" />
Run Code Online (Sandbox Code Playgroud)
http://postimg.org/image/9e92i8k2j/ - > 2 http://postimg.org/image/lfdj7udhv/ - > 3