:layout_centerInParent = "true" をDNT利用アンドロイド:layout_marginLeftは= "150DP型"
とTextViewには、このリンクそれで
tv.setText(Html
.fromHtml("<a href='Banana'>Banana</a>"));
tv.setMovementMethod(LinkMovementMethod.getInstance());
// Performing action on TouchListener of ForgotPassword
tvforgotpwd.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
Intent Forgotpwdintent = new Intent();
Forgotpwdintent.setClass(getApplicationContext(),
Kicthenscreen.class);
startActivity(Forgotpwdintent);
return true;
}
});
ルッククリック可能にするには便利なことがあります...私は相対的なレイアウトを試してみましたhttp://coderzheaven.com/2011/05/textview-with-link-in-android/
XMLファイルは、..です
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/textView1"
android:text="TextView" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/textView2"
android:text="TextView" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_toRightOf="@id/textView3"
android:text="TextView" />
</RelativeLayout>
と私はこのようなJavaファイルに書いた...私のために
TextView tv=(TextView)findViewById(R.id.textView3);
tv.setText(Html.fromHtml("<a href='Banana'>Banana</a>"));
tv.setClickable(true);
tv.setMovementMethod(LinkMovementMethod.getInstance());
tv.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(), "hai", Toast.LENGTH_LONG).show();
return true;
}
});
のみを中央に整列レイアウト..
ありがとう – Android
のthnx: アンドロイドでlayout_centerHorizontal =「true」を :あなたが画面の中央にテキストを揃えたい場合は、任意の方法はそれほどのLinearLayoutパラメータ アンドロイドを置き換える返信 – Android