Tag: textview

Android和  在TextView中

是否可以添加  在TextView中? 有没有人获得类似的function? 我想在TextView中有非易碎空间。

在Android中的TextView下绘制下划线

我想在我的TextView下面画下划线。 我search了一些内容,但没有find任何有用的东西。 任何人都可以请帮我在这里?

有没有办法让椭圆大小=“选框”总是滚动?

我想在TextView上使用选取框效果,但TextView获取焦点时只能滚动文本。 这是一个问题,因为在我的情况下,它不能。 我在用: android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" 有没有办法让TextView总是滚动它的文本? 我已经在Android Market应用程序中看到了这一点,即使它没有获得焦点,应用程序名称也会在标题栏中滚动,但是我无法在API文档中find它。

在android中的textview圆angular

我有一个textview,并希望其angular落圆形。 我已经知道它可以使用android:background="@drawable/somefile" 。 在我的情况下,这个标签已经包含在内,所以不能再次使用。 例如android:background="@drawable/mydialogbox"已经在后台创build图像了 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_gravity="top" android:background="@drawable/mydialogbox" android:orientation="horizontal" > <TextView android:id="@+id/textview_name" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" /> </LinearLayout> </RelativeLayout> 所以当我想要textview(textview_name)也圆angular,这是如何实现的。

Android:切断了最后一行的textview

我有一个水平的LinearLayout包含一个TextView紧接着旁边的Spinner 。 这个LinearLayout在RelativeLayout包含的固定垂直LinearLayout中被dynamic地多次膨胀。 问题是,因为我从Theme.light切换到Theme.holo.light , TextView的最后一行被切成两半。 当dynamic文本很长并跨越多行时,会发生这种情况。 我已经能够通过添加底部填充到包含TextView和Spinner的水平LinearLayout来解决这个问题。 这不是一个修复,但更多的是一个黑客。 有人可以请给我一些build议,如何妥善解决这个问题? 我也读了一些其他的问题,但似乎没有任何帮助。 水平线性布局: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/textView1" android:layout_width="150dp" android:layout_height="wrap_content" android:layout_marginRight="20dp" android:text="TextView"/> <Spinner android:id="@+id/spinner1" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout> 相对布局,其中上面的布局在ID为ll2_7的线性布局中dynamic膨胀: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <ScrollView android:id="@+id/scrollView" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_above="@+id/relLayoutButtonNext" android:layout_below="@id/textView1" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingBottom="20dp" android:paddingLeft="10dp" android:paddingRight="10dp" android:paddingTop="10dp" > […]

Android中的多行TextView?

我在xml如下所示 <TableRow> <TextView android:id="@+id/address1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="left" android:maxLines="4" android:singleLine="false" android:text="Johar Mor, Gulistan-e-Johar, Karachi" > </TextView> </TableRow> 它不适用于multiline ,我正在使用TableLayout … 所以我在这里做错了什么?

以编程方式更改视图的右边距?

Java代码中可以dynamic改变这个属性吗? android:layout_marginRight 我有一个TextView ,它必须改变它的位置dynamic左边的一些像素。 如何以编程方式做到这一点?

如何在Android TextView中添加换行符?

我正在尝试在TextView中添加换行符。 我试过build议\ n但是什么都不做。 这是我如何设置我的文本。 TextView txtSubTitle = (TextView)findViewById(r.id.txtSubTitle); txtSubTitle.setText(Html.fromHtml(getResources().getString(R.string.sample_string))); 这是我的string: <string name="sample_string">some test line 1 \n some test line 2</string> 它应该显示如下: some test line 1 some test line 2 但它显示如下: some test line 1 some test line 2 。 我错过了什么吗?

如何以编程方式设置Android TextView中的maxLength?

我想以编程方式设置TextView maxLength属性,因为我不想在布局中对其进行硬编码。 我看不到任何有关maxLength set方法。 任何人都可以指导我如何实现这一目标?

删除一个onclick监听器

我有一个对象的文本循环和显示状态消息。 当消息发生变化时,我想要更改对象的单击事件以将您带到消息所关联的活动。 所以,我有一个TextView mTitleView ,我分配这样的事件。 public void setOnTitleClickListener(OnClickListener listener) { mTitleView.setOnClickListener(listener); } 如何删除该点击事件? 有一些状态消息没有可操作的区域,所以我想closures点击事件。 我也希望能够循环浏览这些点击事件并妥善处理它们,但我不确定最佳做法。