Здравствуйте, господа. На андроиде новичек вот и первый запар появился.
Сразу к делу Вообщем у меня есть фрагмент и закидываю ее лейоут главного активити
а там есть ScroolView так вот он мне теперь все мои листы в размер одного листа запихнул. Все испробовал. Помогите
Xml основного блока куда кидаю фрагмент
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scroll">
<LinearLayout
android:id="@+id/linLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<fragment
android:name="com.example.serik.astanawebmarket.fragments.ListFragm"
android:layout_width="match_parent"
android:layout_height="match_parent">
</fragment>
</LinearLayout>
</ScrollView>
xml фрагмента
<TextView
android:id="@+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_gravity="top|center_horizontal"
android:textSize="24sp">
</TextView>
<TextView
android:id="@+id/tvSalary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_gravity="bottom|right"
android:layout_marginRight="5dp">
</TextView>
<TextView
android:id="@+id/tvPosition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginLeft="5dp">
</TextView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:layout_gravity="left|top"
android:src="@android:drawable/alert_light_frame"/>
кидаю так
List> aList = new ArrayList>();
for(int i=0;i<name.length;i++){
HashMap<String, String> hm = new HashMap<String,String>();
hm.put("tvName", name[i]);
hm.put("tvPosition","Должность: " + position[i]);
hm.put("tvSalary", "Оклад: "+Integer.toString(salary[i]) );
aList.add(hm);
}
SpecialAdapter adapter = new SpecialAdapter (getActivity().getBaseContext(), aList, R.layout.fragment_item, new String[] { "tvName","tvPosition","tvSalary" },
new int[]{ R.id.tvName,R.id.tvPosition,R.id.tvSalary});
setListAdapter(adapter);
return super.onCreateView(inflater, container, savedInstanceState);