2
Я После компоновки сценарияНажмите Событие View Внутри Framelayout
Хотите реализовать Нажмите даже TextView
..но TextView
Нажмите не работает
Вот Пример кода
<FrameLayout
android:id="@+id/frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:clickable="false">
<customview
android:id="@+id/custom"
android:layout_width="200dp"
android:layout_height="200dp"
android:clickable="false"/>
<LinearLayout
android:id="@+id/abc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical" >
<TextView
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/zero_done"
android:padding="5dp"
android:clickable="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold" />
</LinearLayout>
My TextView
ClickEvent не работает ... пожалуйста, помогите мне
Код класса
TextView view= (TextView) findViewById(R.id.btn);
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(), "Press",
Toast.LENGTH_SHORT).show();
}
});
Пожалуйста, вы можете показать нам код, где вы назначаете onClickListener? –
@BojanKseneman проверить обновление –
Можете ли вы попытаться изменить его id на что-то еще, может быть, у вас есть другое представление с этим id. Используйте что-то вроде tvBtn123 –