Giter Club home page Giter Club logo

Comments (4)

yongchao1210 avatar yongchao1210 commented on August 18, 2024

info_known.xml 文件中
ImageView
android:id="@+id/iv_known"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/id_iv_tip"
android:src="@drawable/jt_known"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:paddingRight="10dp"
android:onClick="clickKnown"

android:onClick不能用在Fragment的xml中。。。
如何破。。。

from highlight.

DuShuYuan avatar DuShuYuan commented on August 18, 2024

mHightLight.getHightLightView().findViewById(R.id.iv_known).setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
clickKnown();
}
});

这样写可以,你运行试试吧还会出其他问题,开始是空指针,你会解决的;弄好以后fragment来回切换还会出问题这个我也解决不了了

from highlight.

DuShuYuan avatar DuShuYuan commented on August 18, 2024

只能是在ativity里使用了。
在activity里拿到fragment的view就行了
有这个方法:
addHighLight(View view, int decorLayoutId, OnPosCallback onPosCallback, LightShape lightShape)

from highlight.

chuzhonglingyan avatar chuzhonglingyan commented on August 18, 2024

注入的点击事件clickKnown写到activity可行。

from highlight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.