我有一些TextView
s 里面LinearLayout
。在运行时,LinearLayout
是可见的,但都不TextViews
是。这是 XML:
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.5384615384615385"
android:scaleType="fitXY"
android:adjustViewBounds="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
>
<TextView
android:id="@+id/onezero"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="one"
android:typeface="sans"
android:layout_weight="1"
android:layout_margin="17dp"
android:textIsSelectable="true"
android:clickable="true" />
<TextView
android:id="@+id/oneone"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="two"
android:typeface="sans"
android:layout_margin="17dp"
android:textIsSelectable="true"
android:clickable="true" />
<TextView
android:id="@+id/onefour"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="three"
android:layout_weight="1"
android:typeface="sans"
android:layout_margin="17dp"
android:textIsSelectable="true"
android:clickable="true" />
<TextView
android:id="@+id/other"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="four"
android:layout_margin="17dp"
android:typeface="sans"
android:layout_weight="1"
android:textIsSelectable="true"
android:clickable="true" />
</LinearLayout>
<ScrollView
android:id="@+id/scrollview1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:fillViewport="true">
<TextView
android:id="@+id/tv1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:typeface="sans"
android:textSize="17sp"
/>
</ScrollView>
</LinearLayout>
</FrameLayout>
如何使它们可见?
编辑:访问此布局的代码:
void fragment(){
ten.setTextColor(0xFFFFFF);//These are the 4 TextViews
eleven.setTextColor(0xFFFFFF);
fourteen.setTextColor(0xFFFFFF);
other.setTextColor(0xFFFFFF);
ten.setVisibility(View.VISIBLE);
eleven.setVisibility(View.VISIBLE);
fourteen.setVisibility(View.VISIBLE);
other.setVisibility(View.VISIBLE);
}
我正在初始化文本视图的代码:
ten=(TextView)findViewById(R.id.onezero);
eleven=(TextView)findViewById(R.id.oneone);
fourteen=(TextView)findViewById(R.id.onefour);
other=(TextView)findViewById(R.id.other);
编辑:我尝试点击 LinearLayout 区域并且 TextViews 正在注册点击..这意味着它们在那里但不可见......