嗨,我有以下XML佈局如何讓根據TextView的標籤以便集中
<Button android:id="@+id/signupButton"
android:layout_gravity="left"
android:layout_width="100sp"
android:layout_height="wrap_content"
android:layout_marginLeft = "10px"
android:layout_marginTop = "10px"
android:text="Sign-Up"/>
<TextView
android:id="@+id/accountlabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text = "Forgot password"
android:textColor = "#000000"
android:layout_marginLeft = "10px"
android:layout_marginTop = "10px"
android:textSize="15sp"
android:paddingLeft="3px"
android:paddingRight="3px"
/>
<Button
android:id="@+id/cancelButton"
android:layout_gravity="right"
android:layout_width="100sp"
android:layout_height="wrap_content"
android:layout_marginLeft = "10px"
android:layout_marginTop = "10px"
android:text="SignOut"/>
</LinearLayout>
我的問題是,焦點只到一個按鈕another.it不會去textview因爲我的文字是可點擊的,所以我也需要關注它。
我讀了幾個解決方案,如android:focusable =「true」在textview中添加,但它沒有奏效。
有人對此有任何解決方案。
感謝
我添加了android:clickable =「true」,並在setOnClickListener中獲得了它的事件。實際上,當我想通了,我的重點轉到textview,但它不顯示在用戶界面。由於按鈕在焦點時變爲橙色,但textview不會改變任何顏色,所以我們認爲焦點不在textview上。 – Rishi 2011-03-22 11:45:25
有沒有辦法找到什麼時候texview獲得焦點並更改其背景色,以便在UI上反映出來,以便人們可以很容易地識別出textview已獲得焦點。 – Rishi 2011-03-22 11:46:27
@Rishi只是considor現在textview作爲按鈕現在在類編碼textview可以應用像按鈕 – Siten 2011-03-22 13:27:47