我们正在使用片段兼容性库,并试图获得片段的宽度,添加到FrameLayout.根据片段生命周期,直到onCreateView被执行,getView().getMeasuredWidth()应该返回0.但是,我们在onStart()中得到0,它出现在onCreateView之后,因此,返回的值不应该是0.
这是我们想知道的宽度的片段:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<FrameLayout android:id="@+id/details"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/carbon_fiber"/>
Run Code Online (Sandbox Code Playgroud)
为什么会出现这种异常现象?任何帮助将不胜感激.
我知道我可以找出来自哪个分区记录,但我想知道有什么方法可以动态获取在特定时刻为消费者分配哪些分区?也许我需要实现一些监听器来检测和跟踪分区分配信息?
我正在使用spring-kafka 1.3.2
和ConcurrentKafkaListenerContainerFactory
。@KafkaListener