我在android中創建一個imageview和textview的HTML代碼的幫助,所以我的問題是如何對齊文本,當我點擊閱讀更多,然後將打開新的頁面,所以..這裏是我的完整源code.can誰能幫我please.thanks提前如何在Android中使用html代碼對齊文本
MainActivity
public class MainActivity extends Activity {
private final String htmlText = "<body><h1>Heading Text</h1><p>We understand that different client have different needs and requirements therefore special effort might be required to fulfill these requirements. Our custom software development services are aimed to fulfill......Read More </p>" +
"<blockquote>Example from <a href=\"www.javatechig.com\">" +
"Javatechig.com<a></blockquote></body>";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView htmlTextView = (TextView)findViewById(R.id.html_text);
htmlTextView.setText(Html.fromHtml(htmlText));
}
}
我的佈局
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
>
<ImageView
android:id="@+id/imageView1"
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/home" />
<TextView
android:id="@+id/html_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_toRightOf="@+id/imageView1"
/>
</RelativeLayout>
我添加了此代碼,但所有文本也包含以下textview .... – 2015-04-01 08:52:11
對不起,你不能請你提供提供更多的細節? – 2015-04-01 09:06:51
例如我有一個像因此,當我點擊閱讀更多,然後將打開新的android佈局活動....先生可以ü指導我請 –
2015-04-01 11:02:25